[cfe-commits] r86597 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaExpr.cpp test/Sema/pointer-conversion.c

Fariborz Jahanian fjahanian at apple.com
Mon Nov 9 14:16:37 PST 2009


Author: fjahanian
Date: Mon Nov  9 16:16:37 2009
New Revision: 86597

URL: http://llvm.org/viewvc/llvm-project?rev=86597&view=rev
Log:
Changed error for nested type qualifier mismatch to
warning, to match gcc. It used to be warning, so
better keep it a warning (it broke a certain project).

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

Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=86597&r1=86596&r2=86597&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Nov  9 16:16:37 2009
@@ -1836,7 +1836,7 @@
   "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">,

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=86597&r1=86596&r2=86597&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Nov  9 16:16:37 2009
@@ -6242,7 +6242,7 @@
     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;

Modified: cfe/trunk/test/Sema/pointer-conversion.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/pointer-conversion.c?rev=86597&r1=86596&r2=86597&view=diff

==============================================================================
--- cfe/trunk/test/Sema/pointer-conversion.c (original)
+++ cfe/trunk/test/Sema/pointer-conversion.c Mon Nov  9 16:16:37 2009
@@ -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}}





More information about the cfe-commits mailing list