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

llvm-svn: 259604
This commit is contained in:
Richard Smith 2016-02-02 23:34:49 +00:00
parent 60adac46f2
commit 83c2ecf9fa
2 changed files with 3 additions and 1 deletions

View File

@ -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))) {

View File

@ -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.