summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/vector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/vector.cpp')
-rw-r--r--clang/test/SemaCXX/vector.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/vector.cpp b/clang/test/SemaCXX/vector.cpp
index 40dcd35c1bb..295e1e17323 100644
--- a/clang/test/SemaCXX/vector.cpp
+++ b/clang/test/SemaCXX/vector.cpp
@@ -342,3 +342,19 @@ void test_vector_literal(inte4 res) {
inte4 b = (inte4)(a, a); //expected-error{{C-style cast from vector 'inte2' (vector of 2 'int' values) to vector 'inte4' (vector of 4 'int' values) of different size}} //expected-warning{{expression result unused}}
}
+typedef __attribute__((__ext_vector_type__(4))) float vector_float4;
+typedef __attribute__((__ext_vector_type__(4))) int vector_int4;
+
+namespace swizzle_template_confusion {
+ template<typename T> struct xyzw {};
+ vector_int4 foo123(vector_float4 &A, vector_float4 &B) {
+ return A.xyzw < B.x && B.y > A.y; // OK, not a template-id
+ }
+}
+
+namespace swizzle_typo_correction {
+ template<typename T> struct xyzv {};
+ vector_int4 foo123(vector_float4 &A, vector_float4 &B) {
+ return A.xyzw < B.x && B.y > A.y; // OK, not a typo for 'xyzv'
+ }
+}
OpenPOWER on IntegriCloud