forked from OSchip/llvm-project
Don't crash on access decls with invalid scope specifier, PR20887.
llvm-svn: 217472
This commit is contained in:
parent
0ae7980c90
commit
ef03e70573
|
@ -2072,6 +2072,11 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
|
||||||
ParseOptionalCXXScopeSpecifier(SS, ParsedType(),
|
ParseOptionalCXXScopeSpecifier(SS, ParsedType(),
|
||||||
/*EnteringContext=*/false);
|
/*EnteringContext=*/false);
|
||||||
|
|
||||||
|
if (SS.isInvalid()) {
|
||||||
|
SkipUntil(tok::semi);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Try to parse an unqualified-id.
|
// Try to parse an unqualified-id.
|
||||||
SourceLocation TemplateKWLoc;
|
SourceLocation TemplateKWLoc;
|
||||||
UnqualifiedId Name;
|
UnqualifiedId Name;
|
||||||
|
|
|
@ -174,6 +174,11 @@ class PR20760_b {
|
||||||
int f = d // expected-warning {{extension}} expected-error {{expected ';'}}
|
int f = d // expected-warning {{extension}} expected-error {{expected ';'}}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
namespace PR20887 {
|
||||||
|
class X1 { a::operator=; }; // expected-error {{undeclared identifier 'a'}}
|
||||||
|
class X2 { a::a; }; // expected-error {{undeclared identifier 'a'}}
|
||||||
|
}
|
||||||
|
|
||||||
// PR11109 must appear at the end of the source file
|
// PR11109 must appear at the end of the source file
|
||||||
class pr11109r3 { // expected-note{{to match this '{'}}
|
class pr11109r3 { // expected-note{{to match this '{'}}
|
||||||
public // expected-error{{expected ':'}} expected-error{{expected '}'}} expected-error{{expected ';' after class}}
|
public // expected-error{{expected ':'}} expected-error{{expected '}'}} expected-error{{expected ';' after class}}
|
||||||
|
|
Loading…
Reference in New Issue