forked from OSchip/llvm-project
C++11 attributes after 'constructor-name (' unambiguously signal that we have a
constructor. llvm-svn: 190111
This commit is contained in:
parent
8bc633ac09
commit
f216366e64
|
@ -4234,6 +4234,15 @@ bool Parser::isConstructorDeclarator() {
|
|||
return true;
|
||||
}
|
||||
|
||||
// A C++11 attribute here signals that we have a constructor, and is an
|
||||
// attribute on the first constructor parameter.
|
||||
if (getLangOpts().CPlusPlus11 &&
|
||||
isCXX11AttributeSpecifier(/*Disambiguate*/ false,
|
||||
/*OuterMightBeMessageSend*/ true)) {
|
||||
TPA.Revert();
|
||||
return true;
|
||||
}
|
||||
|
||||
// If we need to, enter the specified scope.
|
||||
DeclaratorScopeObj DeclScopeObj(*this, SS);
|
||||
if (SS.isSet() && Actions.ShouldEnterDeclaratorScope(getCurScope(), SS))
|
||||
|
|
|
@ -281,3 +281,8 @@ int v5()[[gnu::unused]]; // expected-warning {{attribute 'unused' ignored}}
|
|||
[[attribute_declaration]]; // expected-warning {{unknown attribute 'attribute_declaration' ignored}}
|
||||
[[noreturn]]; // expected-error {{'noreturn' attribute only applies to functions and methods}}
|
||||
[[carries_dependency]]; // expected-error {{'carries_dependency' attribute only applies to functions, methods, and parameters}}
|
||||
|
||||
class A {
|
||||
A([[gnu::unused]] int a);
|
||||
};
|
||||
A::A([[gnu::unused]] int a) {}
|
||||
|
|
Loading…
Reference in New Issue