diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2015-10-08 10:04:46 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2015-10-08 10:04:46 +0000 |
| commit | dc9be216c0f20dcf49f885ba26af845c709a3b50 (patch) | |
| tree | e273456666c1ea262002f2f06801f01cadf21116 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
| parent | 4069730c75152f082ae61b0ab1526f1a685e9587 (diff) | |
| download | bcm5719-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.cpp | 3 |
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); } } |

