aboutsummaryrefslogtreecommitdiff
path: root/test/SemaTemplate/ext-vector-type.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaTemplate/ext-vector-type.cpp')
-rw-r--r--test/SemaTemplate/ext-vector-type.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/SemaTemplate/ext-vector-type.cpp b/test/SemaTemplate/ext-vector-type.cpp
index b6aebc102fb4..7cc4ae930ed2 100644
--- a/test/SemaTemplate/ext-vector-type.cpp
+++ b/test/SemaTemplate/ext-vector-type.cpp
@@ -45,3 +45,16 @@ struct make5 {
typedef int_ptr __attribute__((ext_vector_type(Length))) type; // expected-error{{invalid vector type}}
};
+template<int Length>
+struct make6 {
+ typedef int __attribute__((ext_vector_type(Length))) type;
+};
+
+int test_make6() {
+ make6<4>::type x;
+ x.w = 7;
+
+ make6<2>::type y;
+ y.x = -1;
+ y.w = -1; // expected-error{{vector component access exceeds type}}
+}