]> granicus.if.org Git - clang/commit
Do not add enums to prototype scope in C++ modes.
authorPeter Collingbourne <peter@pcc.me.uk>
Sat, 22 Feb 2014 03:05:49 +0000 (03:05 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Sat, 22 Feb 2014 03:05:49 +0000 (03:05 +0000)
commit3d8ada65463bb8f60bfa08964050e40eab1caa36
treea0ee9f7bca317cdd5db4d4220db8c31b8949904b
parentc7ecd63edfc41546d1c6b18f4e0b9bc7c7f7c408
Do not add enums to prototype scope in C++ modes.

The language forbids defining enums in prototypes, so this check is normally
redundant, but if an enum is defined during template instantiation it should
not be added to the prototype scope.

While at it, clean up the code that deals with tag definitions in prototype
scope and expand the visibility warning to cover the case where an anonymous
enum is defined.

Differential Revision: http://llvm-reviews.chandlerc.com/D2742

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201927 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Parse/ParseDecl.cpp
lib/Sema/SemaDecl.cpp
test/Sema/decl-in-prototype.c
test/SemaTemplate/instantiate-enum.cpp