From: Chris Lattner Date: Wed, 2 Apr 2008 17:15:17 +0000 (+0000) Subject: improve error to be something end users will actually understand :) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=26b7661b1db92ed611f5c02d61e40e4071aa2058;p=clang improve error to be something end users will actually understand :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49097 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Basic/DiagnosticKinds.def b/include/clang/Basic/DiagnosticKinds.def index 494eb59ddd..e8e6fa097e 100644 --- a/include/clang/Basic/DiagnosticKinds.def +++ b/include/clang/Basic/DiagnosticKinds.def @@ -667,7 +667,7 @@ DIAG(warn_typecheck_function_qualifiers, WARNING, DIAG(err_typecheck_invalid_restrict_not_pointer, ERROR, "restrict requires a pointer or reference ('%0' is invalid)") DIAG(err_typecheck_invalid_restrict_invalid_pointee, ERROR, - "restrict pointee must be an object or incomplete type ('%0' is invalid)") + "pointer to function type ('%0') may not be 'restrict' qualified") DIAG(ext_typecheck_zero_array_size, EXTENSION, "zero size arrays are an extension") DIAG(err_at_least_one_initializer_needed_to_size_array, ERROR, diff --git a/test/Sema/declspec.c b/test/Sema/declspec.c index 36e54b25a7..1e84d6523e 100644 --- a/test/Sema/declspec.c +++ b/test/Sema/declspec.c @@ -18,6 +18,6 @@ typedef int f(void); typedef f* fptr; const f* v1; // expected-warning {{qualifier on function type 'f' has unspecified behavior}} __restrict__ f* v2; // expected-error {{restrict requires a pointer or reference ('f' is invalid)}} -__restrict__ fptr v3; // expected-error {{estrict pointee must be an object or incomplete type ('f' is invalid)}} -f *__restrict__ v4; // expected-error {{restrict pointee must be an object or incomplete type ('f' is invalid)}} +__restrict__ fptr v3; // expected-error {{pointer to function type ('f') may not be 'restrict' qualified}} +f *__restrict__ v4; // expected-error {{pointer to function type ('f') may not be 'restrict' qualified}}