forked from OSchip/llvm-project
CXXThisScopeRAII objects aren't free, don't compute one if it's unused.
llvm-svn: 156987
This commit is contained in:
parent
0fc33af2a7
commit
1d373c6517
|
@ -459,7 +459,7 @@ void Parser::ParseLexedMemberInitializers(ParsingClass &Class) {
|
||||||
Actions.ActOnStartDelayedMemberDeclarations(getCurScope(),
|
Actions.ActOnStartDelayedMemberDeclarations(getCurScope(),
|
||||||
Class.TagOrTemplate);
|
Class.TagOrTemplate);
|
||||||
|
|
||||||
{
|
if (!Class.LateParsedDeclarations.empty()) {
|
||||||
// C++11 [expr.prim.general]p4:
|
// C++11 [expr.prim.general]p4:
|
||||||
// Otherwise, if a member-declarator declares a non-static data member
|
// Otherwise, if a member-declarator declares a non-static data member
|
||||||
// (9.2) of a class X, the expression this is a prvalue of type "pointer
|
// (9.2) of a class X, the expression this is a prvalue of type "pointer
|
||||||
|
|
|
@ -742,7 +742,7 @@ void Parser::ParseLexedAttributes(ParsingClass &Class) {
|
||||||
if (!AlreadyHasClassScope)
|
if (!AlreadyHasClassScope)
|
||||||
Actions.ActOnStartDelayedMemberDeclarations(getCurScope(),
|
Actions.ActOnStartDelayedMemberDeclarations(getCurScope(),
|
||||||
Class.TagOrTemplate);
|
Class.TagOrTemplate);
|
||||||
{
|
if (!Class.LateParsedDeclarations.empty()) {
|
||||||
// Allow 'this' within late-parsed attributes.
|
// Allow 'this' within late-parsed attributes.
|
||||||
Sema::CXXThisScopeRAII ThisScope(Actions, Class.TagOrTemplate,
|
Sema::CXXThisScopeRAII ThisScope(Actions, Class.TagOrTemplate,
|
||||||
/*TypeQuals=*/0);
|
/*TypeQuals=*/0);
|
||||||
|
|
|
@ -1942,7 +1942,7 @@ Sema::InstantiateClass(SourceLocation PointOfInstantiation,
|
||||||
CheckCompletedCXXClass(Instantiation);
|
CheckCompletedCXXClass(Instantiation);
|
||||||
|
|
||||||
// Attach any in-class member initializers now the class is complete.
|
// Attach any in-class member initializers now the class is complete.
|
||||||
{
|
if (!FieldsWithMemberInitializers.empty()) {
|
||||||
// C++11 [expr.prim.general]p4:
|
// C++11 [expr.prim.general]p4:
|
||||||
// Otherwise, if a member-declarator declares a non-static data member
|
// Otherwise, if a member-declarator declares a non-static data member
|
||||||
// (9.2) of a class X, the expression this is a prvalue of type "pointer
|
// (9.2) of a class X, the expression this is a prvalue of type "pointer
|
||||||
|
|
Loading…
Reference in New Issue