Fix a crash that occurs in this C++ case:
struct foo { static bool value; }; bool (foo::value); // crash because of parens llvm-svn: 76538
This commit is contained in:
parent
83423aa276
commit
1a176f0b96
|
@ -1080,17 +1080,22 @@ private:
|
|||
class DeclaratorScopeObj {
|
||||
Parser &P;
|
||||
CXXScopeSpec &SS;
|
||||
bool EnteredScope;
|
||||
public:
|
||||
DeclaratorScopeObj(Parser &p, CXXScopeSpec &ss) : P(p), SS(ss) {}
|
||||
DeclaratorScopeObj(Parser &p, CXXScopeSpec &ss)
|
||||
: P(p), SS(ss), EnteredScope(false) {}
|
||||
|
||||
void EnterDeclaratorScope() {
|
||||
if (SS.isSet())
|
||||
P.Actions.ActOnCXXEnterDeclaratorScope(P.CurScope, SS);
|
||||
assert(SS.isSet() && "C++ scope was not set!");
|
||||
P.Actions.ActOnCXXEnterDeclaratorScope(P.CurScope, SS);
|
||||
EnteredScope = true;
|
||||
}
|
||||
|
||||
~DeclaratorScopeObj() {
|
||||
if (SS.isSet())
|
||||
if (EnteredScope) {
|
||||
assert(SS.isSet() && "C++ scope was cleared ?");
|
||||
P.Actions.ActOnCXXExitDeclaratorScope(P.CurScope, SS);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -172,7 +172,10 @@ X::X() : a(5) { } // expected-error{{use of undeclared identifier 'X'}} \
|
|||
// expected-error{{C++ requires a type specifier for all declarations}} \
|
||||
// expected-error{{only constructors take base initializers}}
|
||||
|
||||
|
||||
struct foo_S {
|
||||
static bool value;
|
||||
};
|
||||
bool (foo_S::value);
|
||||
|
||||
|
||||
namespace somens {
|
||||
|
|
Loading…
Reference in New Issue