r259604 - Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 2 15:34:49 PST 2016


Author: rsmith
Date: Tue Feb  2 17:34:49 2016
New Revision: 259604

URL: http://llvm.org/viewvc/llvm-project?rev=259604&view=rev
Log:
Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'.

Modified:
    cfe/trunk/lib/Parse/ParseDecl.cpp
    cfe/trunk/test/Parser/cxx0x-decl.cpp

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=259604&r1=259603&r2=259604&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Tue Feb  2 17:34:49 2016
@@ -4931,7 +4931,7 @@ void Parser::ParseDeclaratorInternal(Dec
   // Member pointers get special handling, since there's no place for the
   // scope spec in the generic path below.
   if (getLangOpts().CPlusPlus &&
-      (Tok.is(tok::coloncolon) ||
+      (Tok.is(tok::coloncolon) || Tok.is(tok::kw_decltype) ||
        (Tok.is(tok::identifier) &&
         (NextToken().is(tok::coloncolon) || NextToken().is(tok::less))) ||
        Tok.is(tok::annot_cxxscope))) {

Modified: cfe/trunk/test/Parser/cxx0x-decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/cxx0x-decl.cpp?rev=259604&r1=259603&r2=259604&view=diff
==============================================================================
--- cfe/trunk/test/Parser/cxx0x-decl.cpp (original)
+++ cfe/trunk/test/Parser/cxx0x-decl.cpp Tue Feb  2 17:34:49 2016
@@ -17,6 +17,8 @@ auto g() -> enum E {
   return E();
 }
 
+int decltype(f())::*ptr_mem_decltype;
+
 class ExtraSemiAfterMemFn {
   // Due to a peculiarity in the C++11 grammar, a deleted or defaulted function
   // is permitted to be followed by either one or two semicolons.




More information about the cfe-commits mailing list