summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/vector.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2013-09-13 20:43:08 +0000
committerAaron Ballman <aaron@aaronballman.com>2013-09-13 20:43:08 +0000
commit8c9795d9fa94a7478d18e3906dff2408f379e8d9 (patch)
tree22c5238631492d3a23fe7994350ef67dd91a13a6 /clang/test/SemaCXX/vector.cpp
parentc3cfbf8677bd3da2e93655df9cf3b4215d092f80 (diff)
downloadbcm5719-llvm-8c9795d9fa94a7478d18e3906dff2408f379e8d9.tar.gz
bcm5719-llvm-8c9795d9fa94a7478d18e3906dff2408f379e8d9.zip
vector_size cannot be applied to Booleans. Updated the semantic checking logic, as well as the comment and added a test case. Fixes PR12649
llvm-svn: 190721
Diffstat (limited to 'clang/test/SemaCXX/vector.cpp')
-rw-r--r--clang/test/SemaCXX/vector.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/test/SemaCXX/vector.cpp b/clang/test/SemaCXX/vector.cpp
index 37b586ca3a9..7957c23e3e2 100644
--- a/clang/test/SemaCXX/vector.cpp
+++ b/clang/test/SemaCXX/vector.cpp
@@ -37,7 +37,7 @@ void f2_test(char16 c16, longlong16 ll16, char16_e c16e, longlong16_e ll16e) {
}
// Test the conditional operator with vector types.
-void conditional(bool Cond, char16 c16, longlong16 ll16, char16_e c16e,
+void conditional(bool Cond, char16 c16, longlong16 ll16, char16_e c16e,
longlong16_e ll16e) {
// Conditional operators with the same type.
__typeof__(Cond? c16 : c16) *c16p1 = &c16;
@@ -105,11 +105,11 @@ struct convertible_to { // expected-note 3 {{candidate function (the implicit co
operator T() const;
};
-void test_implicit_conversions(bool Cond, char16 c16, longlong16 ll16,
+void test_implicit_conversions(bool Cond, char16 c16, longlong16 ll16,
char16_e c16e, longlong16_e ll16e,
- convertible_to<char16> to_c16,
- convertible_to<longlong16> to_ll16,
- convertible_to<char16_e> to_c16e,
+ convertible_to<char16> to_c16,
+ convertible_to<longlong16> to_ll16,
+ convertible_to<char16_e> to_c16e,
convertible_to<longlong16_e> to_ll16e,
convertible_to<char16&> rto_c16,
convertible_to<char16_e&> rto_c16e) {
@@ -183,7 +183,7 @@ void test_implicit_conversions(bool Cond, char16 c16, longlong16 ll16,
(void)(Cond? to_c16 : to_c16e);
(void)(Cond? to_ll16e : to_ll16);
-
+
// These 2 are convertable with -flax-vector-conversions (default)
(void)(Cond? to_c16 : to_ll16);
(void)(Cond? to_c16e : to_ll16e);
@@ -282,3 +282,6 @@ void test_pseudo_dtor(fltx4 *f) {
// PR16204
typedef __attribute__((ext_vector_type(4))) int vi4;
const int &reference_to_vec_element = vi4(1).x;
+
+// PR12649
+typedef bool bad __attribute__((__vector_size__(16))); // expected-error {{invalid vector element type 'bool'}}
OpenPOWER on IntegriCloud