[cfe-commits] r49097 - in /cfe/trunk: include/clang/Basic/DiagnosticKinds.def test/Sema/declspec.c
Chris Lattner
sabre at nondot.org
Wed Apr 2 10:15:31 PDT 2008
Author: lattner
Date: Wed Apr 2 12:15:17 2008
New Revision: 49097
URL: http://llvm.org/viewvc/llvm-project?rev=49097&view=rev
Log:
improve error to be something end users will actually understand :)
Modified:
cfe/trunk/include/clang/Basic/DiagnosticKinds.def
cfe/trunk/test/Sema/declspec.c
Modified: cfe/trunk/include/clang/Basic/DiagnosticKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticKinds.def?rev=49097&r1=49096&r2=49097&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticKinds.def (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticKinds.def Wed Apr 2 12:15:17 2008
@@ -667,7 +667,7 @@
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,
Modified: cfe/trunk/test/Sema/declspec.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/declspec.c?rev=49097&r1=49096&r2=49097&view=diff
==============================================================================
--- cfe/trunk/test/Sema/declspec.c (original)
+++ cfe/trunk/test/Sema/declspec.c Wed Apr 2 12:15:17 2008
@@ -18,6 +18,6 @@
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}}
More information about the cfe-commits
mailing list