[cfe-commits] [patch] Disallow decltype in qualified declarator-ids

David Blaikie dblaikie at gmail.com
Mon Dec 12 23:18:10 PST 2011

8.3\1 dcl.meaning states:
"The nested-name-specifier of a qualified declarator-id shall not
begin with a decltype-specifier."

& this patch implements that, disallowing things like:

struct foo {
  static int i;

int decltype(foo())::i;

The source range in the error message isn't perfect (due to the
unaddressed fixme in DecltypeTypeLoc - it doesn't have the full source
range, just the location of the 'decltype' keyword. I'll address this
separately) & I haven't provided a fixit for this at the moment (it'd
be possible to suggest replacing the decltype with the actual
qualified name, at least for now - I'm not sure what we'll be doing
about unnameable types that come with lambdas, though).

- David
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr10127-no-decltype-declarator.diff
Type: text/x-diff
Size: 3456 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111212/f734e030/attachment.diff>

More information about the cfe-commits mailing list