From 27cac990649d9c1217f018921749683464a28e6b Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 30 Jun 2010 17:30:41 +0000 Subject: [PATCH] Clean up the diagnostic complaining about the element type of a vector type so that it actually complains about the element type itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107299 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Basic/DiagnosticSemaKinds.td | 2 +- test/Sema/ext_vector_casts.c | 2 +- test/Sema/types.c | 2 +- test/SemaTemplate/ext-vector-type.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index fae25196fe..9771245fd6 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -815,7 +815,7 @@ def err_attribute_wrong_number_arguments : Error< "attribute requires %0 argument(s)">; def err_attribute_missing_parameter_name : Error< "attribute requires unquoted parameter">; -def err_attribute_invalid_vector_type : Error<"invalid vector type %0">; +def err_attribute_invalid_vector_type : Error<"invalid vector element type %0">; def err_attribute_argument_not_int : Error< "'%0' attribute requires integer constant">; def err_attribute_argument_outof_range : Error< diff --git a/test/Sema/ext_vector_casts.c b/test/Sema/ext_vector_casts.c index 143ce04e21..76819534db 100644 --- a/test/Sema/ext_vector_casts.c +++ b/test/Sema/ext_vector_casts.c @@ -44,7 +44,7 @@ static void test() { ivec4 += ptr; // expected-error {{can't convert between vector values of different size ('int4' and 'int *')}} } -typedef __attribute__(( ext_vector_type(2) )) float2 vecfloat2; // expected-error{{invalid vector type 'float2'}} +typedef __attribute__(( ext_vector_type(2) )) float2 vecfloat2; // expected-error{{invalid vector element type 'float2'}} void inc(float2 f2) { f2++; // expected-error{{cannot increment value of type 'float2'}} diff --git a/test/Sema/types.c b/test/Sema/types.c index 1770bf5bd0..f3244f7799 100644 --- a/test/Sema/types.c +++ b/test/Sema/types.c @@ -36,4 +36,4 @@ _Decimal32 x; // expected-error {{GNU decimal type extension not supported}} // rdar://6880951 -int __attribute__ ((vector_size (8), vector_size (8))) v; // expected-error {{invalid vector type}} +int __attribute__ ((vector_size (8), vector_size (8))) v; // expected-error {{invalid vector element type}} diff --git a/test/SemaTemplate/ext-vector-type.cpp b/test/SemaTemplate/ext-vector-type.cpp index 3973102b92..7334e88e92 100644 --- a/test/SemaTemplate/ext-vector-type.cpp +++ b/test/SemaTemplate/ext-vector-type.cpp @@ -20,7 +20,7 @@ int test_make2() { template struct make3 { - typedef T __attribute__((ext_vector_type(Length))) type; // expected-error{{invalid vector type 's'}} + typedef T __attribute__((ext_vector_type(Length))) type; // expected-error{{invalid vector element type 's'}} }; struct s {}; @@ -42,7 +42,7 @@ int test_make4() { typedef int* int_ptr; template struct make5 { - typedef int_ptr __attribute__((ext_vector_type(Length))) type; // expected-error{{invalid vector type}} + typedef int_ptr __attribute__((ext_vector_type(Length))) type; // expected-error{{invalid vector element type}} }; template -- 2.40.0