diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-28 23:39:14 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-02-28 23:39:14 +0000 |
commit | 32a9a7543f0296b0ae141899005f788bbe4262ca (patch) | |
tree | 9138950a9aa6223fd1c220ca8fb8feb4e9458f7a /test | |
parent | 2422e82b54aa115bba23da3a44998477720ef6a4 (diff) |
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@151667 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/decl-in-prototype.c | 15 | ||||
-rw-r--r-- | test/Misc/warning-flags.c | 3 | ||||
-rw-r--r-- | test/Sema/decl-in-prototype.c | 33 |
3 files changed, 2 insertions, 49 deletions
diff --git a/test/CodeGen/decl-in-prototype.c b/test/CodeGen/decl-in-prototype.c deleted file mode 100644 index ec7d03fcc6..0000000000 --- a/test/CodeGen/decl-in-prototype.c +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: %clang -emit-llvm -S -o - %s | FileCheck %s - -const int AA = 5; - -// CHECK: define i32 @f1 -int f1(enum {AA,BB} E) { - // CHECK: ret i32 1 - return BB; -} - -// CHECK: define i32 @f2 -int f2(enum {AA=7,BB} E) { - // CHECK: ret i32 7 - return AA; -} diff --git a/test/Misc/warning-flags.c b/test/Misc/warning-flags.c index 5c0e80055a..6621f08fcf 100644 --- a/test/Misc/warning-flags.c +++ b/test/Misc/warning-flags.c @@ -17,7 +17,7 @@ This test serves two purposes: The list of warnings below should NEVER grow. It should gradually shrink to 0. -CHECK: Warnings without flags (256): +CHECK: Warnings without flags (257): CHECK-NEXT: ext_anonymous_struct_union_qualified CHECK-NEXT: ext_binary_literal CHECK-NEXT: ext_cast_fn_obj @@ -137,6 +137,7 @@ CHECK-NEXT: warn_conv_to_base_not_used CHECK-NEXT: warn_conv_to_self_not_used CHECK-NEXT: warn_conv_to_void_not_used CHECK-NEXT: warn_cxx0x_right_shift_in_template_arg +CHECK-NEXT: warn_decl_in_param_list CHECK-NEXT: warn_delete_array_type CHECK-NEXT: warn_division_by_zero CHECK-NEXT: warn_double_const_requires_fp64 diff --git a/test/Sema/decl-in-prototype.c b/test/Sema/decl-in-prototype.c deleted file mode 100644 index 05b8e0a1c3..0000000000 --- a/test/Sema/decl-in-prototype.c +++ /dev/null @@ -1,33 +0,0 @@ -// RUN: %clang_cc1_only -verify %s - -const int AA = 5; - -int f1(enum {AA,BB} E) { - return BB; -} - -int f2(enum {AA=7,BB} E) { - return AA; -} - -struct a { -}; - -int f3(struct a { } *); // expected-warning {{will not be visible outside of this function}} - -struct A { struct b { int j; } t; }; // expected-note {{previous definition is here}} - -int f4(struct A { struct b { int j; } t; } *); // expected-warning {{declaration of 'struct A' will not be visible outside of this function}} expected-warning {{redefinition of 'b' will not be visible outside of this function}} - -struct aA { - struct ab { // expected-note {{previous definition is here}} expected-note {{previous definition is here}} - int j; - } b; -}; - -int f5(struct aA { struct ab { int j; } b; struct ab { char glorx; } glorx; } *); // expected-warning {{declaration of 'struct aA' will not be visible}} expected-warning {{redefinition of 'ab' will not be visible}} expected-warning {{redefinition of 'ab' will not be visible}} - -void f6(struct z {int b;} c) { // expected-warning {{declaration of 'struct z' will not be visible outside of this function}} - struct z d; - d.b = 4; -} |