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

Nikola Smiljanic popizdeh at gmail.com
Sun Jul 15 11:37:30 PDT 2012

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)

But getDeclSpec returns a const reference, I can't modify the thing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120715/d613bf1a/attachment.html>

More information about the cfe-commits mailing list