[cfe-commits] Note and FixIt for additional case of vexing parse

Richard Smith richard at metafoo.co.uk
Sun Jul 15 16:14:34 PDT 2012


On Sun, Jul 15, 2012 at 11:37 AM, Nikola Smiljanic <popizdeh at gmail.com>wrote:

> On Sun, Jul 15, 2012 at 4:19 AM, Richard Smith <richard at metafoo.co.uk>wrote:
>
>>
>> Maybe the parser could store a flag in the DeclSpec to indicate that we
>> hit the function / direct-init ambiguity?
>>
>
> I have a very silly question, I added one bit field to DeclSpec.
>
>   bool isAmbiguous() const { return Ambiguous; }
>   void setAmbiguous() { Ambiguous = true; }
>
> And I tried something like this inside Parser::ParseDirectDeclarator
>
> bool Ambiguous = false; // set to true by isCXXFunctionDeclarator
> if (!isCXXFunctionDeclarator(Ambiguous)) {
>   if (Ambiguous)
>     D.getDeclSpec().setAmbiguous();
>
> But getDeclSpec returns a const reference, I can't modify the thing?
>

Sorry, my bad: I meant to add this to Declarator, not DeclSpec.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120715/dbcd9c4f/attachment.html>


More information about the cfe-commits mailing list