]> granicus.if.org Git - clang/commit
Reapply r151638 and r151641.
authorJames Molloy <james.molloy@arm.com>
Wed, 29 Feb 2012 10:24:19 +0000 (10:24 +0000)
committerJames Molloy <james.molloy@arm.com>
Wed, 29 Feb 2012 10:24:19 +0000 (10:24 +0000)
commit16f1f717af196b1448258857b2e6dcfe144b39d0
tree931424cf36ea32c824895fc76e378e277cd0ceed
parent4fafeb6452a79794726a1adc53fb5e2a5887c5f9
Reapply r151638 and r151641.

The bug that was caught by Apple's internal buildbots was valid and also showed another bug in my implementation.

These are now fixed, with regression tests added to catch them both (not Darwin-specific).

Original log:
====================

Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h

Original log:
---------------------
Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped.

This fixes code such as:

enum e {x, y};
int f(enum {y, x} n) {
 return 0;
}

This finally fixes PR5464 and PR5477.
---------------------

I also reverted r151641 which was enhancement on top of r151638.

====================

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151712 91177308-0d34-0410-b5e6-96231b3b80d8
16 files changed:
include/clang/AST/Decl.h
include/clang/Basic/DiagnosticGroups.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Scope.h
include/clang/Sema/Sema.h
lib/AST/Decl.cpp
lib/AST/DumpXML.cpp
lib/Parse/ParseDecl.cpp
lib/Sema/IdentifierResolver.cpp
lib/Sema/Scope.cpp
lib/Sema/Sema.cpp
lib/Sema/SemaDecl.cpp
test/CodeGen/decl-in-prototype.c [new file with mode: 0644]
test/Misc/warning-flags.c
test/Sema/decl-in-prototype.c [new file with mode: 0644]
test/Sema/fn-ptr-as-fn-prototype.c [new file with mode: 0644]