diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-10 01:33:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-01-10 01:33:14 +0000 |
commit | bdad7a2e21686296b78dac6190b78d11c996f6d7 (patch) | |
tree | a2695b7ffdfd95acfa1966fc6fd43fa38b419a9a /lib/Parse/ParseDeclCXX.cpp | |
parent | 8f0a403945b60a8a8a56a7721bb66f6b84ec129b (diff) |
Update C++11 scoped enumeration support to match the final proposal:
- reject definitions of enums within friend declarations
- require 'enum', not 'enum class', for non-declaring references to scoped
enumerations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147824 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDeclCXX.cpp')
-rw-r--r-- | lib/Parse/ParseDeclCXX.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Parse/ParseDeclCXX.cpp b/lib/Parse/ParseDeclCXX.cpp index 05a346353b..285dbbbe07 100644 --- a/lib/Parse/ParseDeclCXX.cpp +++ b/lib/Parse/ParseDeclCXX.cpp @@ -1115,7 +1115,7 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, if (DS.isFriendSpecified()) { // C++ [class.friend]p2: // A class shall not be defined in a friend declaration. - Diag(Tok.getLocation(), diag::err_friend_decl_defines_class) + Diag(Tok.getLocation(), diag::err_friend_decl_defines_type) << SourceRange(DS.getFriendSpecLoc()); // Skip everything up to the semicolon, so that this looks like a proper @@ -1277,8 +1277,9 @@ void Parser::ParseClassSpecifier(tok::TokenKind TagTokKind, TagOrTempResult = Actions.ActOnTag(getCurScope(), TagType, TUK, StartLoc, SS, Name, NameLoc, attrs.getList(), AS, DS.getModulePrivateSpecLoc(), - TParams, Owned, IsDependent, false, - false, clang::TypeResult()); + TParams, Owned, IsDependent, + SourceLocation(), false, + clang::TypeResult()); // If ActOnTag said the type was dependent, try again with the // less common call. |