]> granicus.if.org Git - clang/commitdiff
Changed error for nested type qualifier mismatch to
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 9 Nov 2009 22:16:37 +0000 (22:16 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 9 Nov 2009 22:16:37 +0000 (22:16 +0000)
warning, to match gcc. It used to be warning, so
better keep it a warning (it broke a certain project).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86597 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaExpr.cpp
test/Sema/pointer-conversion.c

index b78c3994da78fb819e724ccdbed109411484685a..8b76464db34d2bf3e817be2e76b6a81b8b0b2b62 100644 (file)
@@ -1836,7 +1836,7 @@ def ext_typecheck_convert_incompatible_pointer : ExtWarn<
   "incompatible pointer types %2 %1, expected %0">;
 def ext_typecheck_convert_discards_qualifiers : ExtWarn<
   "%2 %1 discards qualifiers, expected %0">;
-def err_nested_pointer_qualifier_mismatch : Error<
+def ext_nested_pointer_qualifier_mismatch : ExtWarn<
   "%2, %0 and %1 have different qualifiers in nested pointer types">;
 def warn_incompatible_vectors : Warning<
   "incompatible vector types %2 %1, expected %0">,
index 887a4c4af49cf1c626f8f534f6b7e012b7e20a90..34b9eb843bb6aac9e256ec5932a95b27d40978a8 100644 (file)
@@ -6242,7 +6242,7 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
     DiagKind = diag::ext_typecheck_convert_discards_qualifiers;
     break;
   case IncompatibleNestedPointerQualifiers:
-    DiagKind = diag::err_nested_pointer_qualifier_mismatch;
+    DiagKind = diag::ext_nested_pointer_qualifier_mismatch;
     break;
   case IntToBlockPointer:
     DiagKind = diag::err_int_to_block_pointer;
index 07176e61df06bf2f97a5806577e388725d87565b..5f41ff67411b941a0bb129a148347fffa7f25d03 100644 (file)
@@ -1,10 +1,10 @@
 //RUN: clang-cc -fsyntax-only -verify %s
 
 char * c;
-char const ** c2 = &c; // expected-error {{initializing, 'char const **' and 'char **' have different qualifiers in nested pointer types}}
+char const ** c2 = &c; // expected-warning {{initializing, 'char const **' and 'char **' have different qualifiers in nested pointer types}}
 
 typedef char dchar;
-dchar *** c3 = &c2; // expected-error {{initializing, 'dchar ***' and 'char const ***' have different qualifiers in nested pointer types}}
+dchar *** c3 = &c2; // expected-warning {{initializing, 'dchar ***' and 'char const ***' have different qualifiers in nested pointer types}}
 
 volatile char * c4;
-char ** c5 = &c4; // expected-error {{initializing, 'char **' and 'char volatile **' have different qualifiers in nested pointer types}}
+char ** c5 = &c4; // expected-warning {{initializing, 'char **' and 'char volatile **' have different qualifiers in nested pointer types}}