]> granicus.if.org Git - clang/commit
[MSVC Compat] Try to treat an implicit, fixed enum as an unfixed enum
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 8 Oct 2015 10:04:46 +0000 (10:04 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 8 Oct 2015 10:04:46 +0000 (10:04 +0000)
commit7ad1bdf876513eb95d3c740a3df359d66d8a85d3
tree986f536ba4c361255f4b41c49a0fe225f08858c6
parent3d04434c638e0e091d0cd49a44cd21c264d57ae0
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249674 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/Sema/bitfield.c
test/Sema/decl-in-prototype.c
test/SemaObjC/default-synthesize-1.m
test/SemaTemplate/instantiate-local-class.cpp