diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index 03bffde06e..87b8a2d906 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -3262,7 +3262,7 @@ void Parser::ParseEnumSpecifier(SourceLocation StartLoc, DeclSpec &DS, ColonProtectionRAIIObject X(*this, AllowFixedUnderlyingType); if (ParseOptionalCXXScopeSpecifier(SS, ParsedType(), - /*EnteringContext=*/false)) + /*EnteringContext=*/true)) return; if (SS.isSet() && Tok.isNot(tok::identifier)) { diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 795d97d3ea..5f7399a3d4 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -9387,6 +9387,11 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, TUK == TUK_Friend, isExplicitSpecialization, Invalid)) { + if (Kind == TTK_Enum) { + Diag(KWLoc, diag::err_enum_template); + return 0; + } + if (TemplateParams->size() > 0) { // This is a declaration or definition of a class template (which may // be a member of another template). |