]> granicus.if.org Git - clang/commitdiff
improve error to be something end users will actually understand :)
authorChris Lattner <sabre@nondot.org>
Wed, 2 Apr 2008 17:15:17 +0000 (17:15 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 2 Apr 2008 17:15:17 +0000 (17:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49097 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticKinds.def
test/Sema/declspec.c

index 494eb59ddd3537b318eb2bb9c4e8236eee01b6e4..e8e6fa097eedddde01440704874e44eb354ffd73 100644 (file)
@@ -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,
index 36e54b25a719a73678eb475027a7ebf451f10657..1e84d6523e7412a831e21cbf4bb00336ee8ba960 100644 (file)
@@ -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}}