summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/conversion.c
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-03-12 00:14:31 +0000
committerDouglas Gregor <dgregor@apple.com>2011-03-12 00:14:31 +0000
commit364f7db0636ae535cb1e9a59cad45b3b102b828d (patch)
treec1954287f8b531ffdc80c8fed873a9dfb793320a /clang/test/Sema/conversion.c
parent30a87e38d904a24f8b7d5c5d9cf2ba4491cdb72b (diff)
downloadbcm5719-llvm-364f7db0636ae535cb1e9a59cad45b3b102b828d.tar.gz
bcm5719-llvm-364f7db0636ae535cb1e9a59cad45b3b102b828d.zip
When we're determining whether to complain about a conversion from one
enumeration type to another in C, classify enumeration constants as if they had the type of their enclosing enumeration. Fixes <rdar://problem/9116337>. llvm-svn: 127514
Diffstat (limited to 'clang/test/Sema/conversion.c')
-rw-r--r--clang/test/Sema/conversion.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/test/Sema/conversion.c b/clang/test/Sema/conversion.c
index 619d6993251..1eaf7082d67 100644
--- a/clang/test/Sema/conversion.c
+++ b/clang/test/Sema/conversion.c
@@ -323,6 +323,10 @@ void test_8559831(enum E8559831b value_a, E8559831c value_c) {
enum E8559831a a1 = value_a; // expected-warning{{implicit conversion from enumeration type 'enum E8559831b' to different enumeration type 'enum E8559831a'}}
a1 = value_a; // expected-warning{{implicit conversion from enumeration type 'enum E8559831b' to different enumeration type 'enum E8559831a'}}
+ test_8559831_a(E8559831b_val); // expected-warning{{implicit conversion from enumeration type 'enum E8559831b' to different enumeration type 'enum E8559831a'}}
+ enum E8559831a a1a = E8559831b_val; // expected-warning{{implicit conversion from enumeration type 'enum E8559831b' to different enumeration type 'enum E8559831a'}}
+ a1 = E8559831b_val; // expected-warning{{implicit conversion from enumeration type 'enum E8559831b' to different enumeration type 'enum E8559831a'}}
+
test_8559831_a(value_c); // expected-warning{{implicit conversion from enumeration type 'E8559831c' to different enumeration type 'enum E8559831a'}}
enum E8559831a a2 = value_c; // expected-warning{{implicit conversion from enumeration type 'E8559831c' to different enumeration type 'enum E8559831a'}}
a2 = value_c; // expected-warning{{implicit conversion from enumeration type 'E8559831c' to different enumeration type 'enum E8559831a'}}
OpenPOWER on IntegriCloud