summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-10-08 10:04:46 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-10-08 10:04:46 +0000
commitdc9be216c0f20dcf49f885ba26af845c709a3b50 (patch)
treee273456666c1ea262002f2f06801f01cadf21116 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parent4069730c75152f082ae61b0ab1526f1a685e9587 (diff)
downloadbcm5719-llvm-dc9be216c0f20dcf49f885ba26af845c709a3b50.tar.gz
bcm5719-llvm-dc9be216c0f20dcf49f885ba26af845c709a3b50.zip
[MSVC Compat] Try to treat an implicit, fixed enum as an unfixed enum
consider the following: enum E *p; enum E { e }; The above snippet is not ANSI C because 'enum E' has not bee defined when we are processing the declaration of 'p'; however, it is a popular extension to make the above work. This would fail using the Microsoft enum semantics because the definition of 'E' would implicitly have a fixed underlying type of 'int' which would trigger diagnostic messages about a mismatch between the declaration and the definition. Instead, treat fixed underlying types as not fixed for the purposes of the diagnostic. llvm-svn: 249674
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 029af186fdc..1789855c40f 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -835,7 +835,8 @@ Decl *TemplateDeclInstantiator::VisitEnumDecl(EnumDecl *D) {
SemaRef.SubstType(TI->getType(), TemplateArgs,
UnderlyingLoc, DeclarationName());
SemaRef.CheckEnumRedeclaration(Def->getLocation(), Def->isScoped(),
- DefnUnderlying, Enum);
+ DefnUnderlying,
+ /*EnumUnderlyingIsImplicit=*/false, Enum);
}
}
OpenPOWER on IntegriCloud