[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cfe-commits
Subject:    Re: [PATCH] Fix parsing comma in default arguments.
From:       Richard Smith <richard () metafoo ! co ! uk>
Date:       2013-06-14 0:05:04
Message-ID: CAOfiQqm01hiEz6U15ecF9YnNaKNV4q5o6=ZRkTVtF=765+_fjw () mail ! gmail ! com
[Download RAW message or body]

On Thu, Jun 13, 2013 at 4:17 PM, Olivier Goffart <ogoffart@kde.org> wrote:
> On Thursday 13 June 2013 13:52:47 Richard Smith wrote:
>> That's not really acceptable, if it can lead to rejecting valid code
>> that we accept now (such as your next example).
>
> Ok, the new attached patch fixes that issue.
>
> I'm now quite happy which what (i think) we cover.
> It even report good errors when one miss a default argument (on the right
> line)
>
> What is still not working is this:
>
> template <int, int =0> struct p { const static int w = 0; };
> struct T {
>      int i = p<0,  p<a<b>::w  >::w, p<0>::*j;
>      static const int a = 1, b = 2;
> };
>
> because a and b are declare after, and the TryAnnotateCXXScopeToken will
> display error as a and b are not defined yet.
>
> But clang did not accept this code before.  And gcc also seems to have a bug
> there.

Right, you can't use TryParseDeclarator during this disambiguation,
because it assumes that it can perform name lookup. You'll need to
skip declarators manually (or at least the scope specifiers within
them).

Thank you for working on this!
_______________________________________________
cfe-commits mailing list
cfe-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic