diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-09-06 00:12:20 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-09-06 00:12:20 +0000 |
commit | f216366e6440eb3c03b42538ffa50bccc0c70138 (patch) | |
tree | 0c90acf0e871cff0ffaced5b0e005da76c06382f /clang/lib | |
parent | 8bc633ac099f68f04c31ece871ed808339ce9067 (diff) | |
download | bcm5719-llvm-f216366e6440eb3c03b42538ffa50bccc0c70138.tar.gz bcm5719-llvm-f216366e6440eb3c03b42538ffa50bccc0c70138.zip |
C++11 attributes after 'constructor-name (' unambiguously signal that we have a
constructor.
llvm-svn: 190111
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 48a30a15b1b..6d7ab979b08 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -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)) |