From: Richard Smith Date: Tue, 2 Feb 2016 23:34:49 +0000 (+0000) Subject: Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7bd13a048884c386d2dcb7122436556b6401c67;p=clang Fix rejects-valid when forming a pointer-to-member with 'decltype(expr)::*'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259604 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 49b593155b..3097d28af1 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -4931,7 +4931,7 @@ void Parser::ParseDeclaratorInternal(Declarator &D, // 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))) { diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp index 23f46a1847..c4f0356602 100644 --- a/test/Parser/cxx0x-decl.cpp +++ b/test/Parser/cxx0x-decl.cpp @@ -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.