Re: Semantic parses function with default argument incorrectly

Bastian Beischer <[email protected]> Wed, 31 Aug 2016 00:11:42 +0200
Newsgroups gmane.emacs.semantic
Message-ID <CAK9AuB9eBND1Ka33jy+CgZjjS5f18SO9d0p0t7C3_dudwrbH2g@mail.gmail.com>
I think I may have found the solution, but it would be great if
someone could check this patch:

diff --git a/lisp/cedet/semantic/bovine/c.by b/lisp/cedet/semantic/bovine/c.by
index 80ed2cf..6c4cea4 100644
--- a/lisp/cedet/semantic/bovine/c.by
+++ b/lisp/cedet/semantic/bovine/c.by
@@ -1250,7 +1250,7 @@ unaryexpression
   | multi-stage-dereference
   | NEW multi-stage-dereference
   | NEW builtintype-types semantic-list
-  | symbol
+  | namespace-symbol
  ;; Klaus Berndl: C/C++ allows sequences of strings which are
  ;; concatenated by the precompiler to one string
   | string-seq

On Tue, Aug 30, 2016 at 11:40 PM, Bastian Beischer
<[email protected]> wrote:
> The following piece of code is not correctly parsed by semantic:
>
> namespace NS {
>  enum TestEnum {a,b};
> }
>
> void f(NS::TestEnum v = NS::a);
>
> This is with the current master branch of http://git.code.sf.net/p/cedet/git.
>
> The issue is that after parsing the buffer 'semantic-describe-tag' on
> the function 'f' reports:
>
> Functions: void f (NS::TestEnum v[=NS],a)
>
> "a" is interpreted as a second argument which is not correct. The
> version of semantic included in Emacs 25.1 RC 2 does not show this
> behavior. Instead it reports:
>
> Functions: void f (NS::TestEnum v[=NS])
>
> which is also not correct, it should report the default value as NS::a.
>
> I think the grammar needs tweaking? Any help on how to fix this?
>
> Cheers
> Bastian
>
> --
> Bastian Beischer
> RWTH Aachen University of Technology
>
> @RWTH Aachen
> Office: 28 C 203
> Phone: +49-241-80-27205
> E-mail: [email protected]
> Address: I. Physikalisches Institut B, Sommerfeldstr. 14, D-52074 Aachen
>
> @CERN
> Office: Bdg 32-4-B12
> Phone: +41-22-76-75750
> E-mail: [email protected]
> Address: CERN, CH-1211 Geneve 23



-- 
Bastian Beischer
RWTH Aachen University of Technology

@RWTH Aachen
Office: 28 C 203
Phone: +49-241-80-27205
E-mail: [email protected]
Address: I. Physikalisches Institut B, Sommerfeldstr. 14, D-52074 Aachen

@CERN
Office: Bdg 32-4-B12
Phone: +41-22-76-75750
E-mail: [email protected]
Address: CERN, CH-1211 Geneve 23

------------------------------------------------------------------------------