[cfe-commits] r113090 - in /cfe/trunk: lib/AST/ test/Analysis/ test/CXX/dcl.decl/dcl.init/ test/CXX/dcl.decl/dcl.init/dcl.init.ref/ test/CXX/dcl.decl/dcl.meaning/dcl.array/ test/CXX/temp/temp.arg/temp.arg.nontype/ test/CXX/temp/temp.decls/temp.mem/ test/Index/ test/Rewriter/ test/Sema/ test/SemaCXX/ test/SemaObjC/ test/SemaObjCXX/ test/SemaTemplate/

Chris Lattner sabre at nondot.org
Sat Sep 4 17:04:02 PDT 2010


Author: lattner
Date: Sat Sep  4 19:04:01 2010
New Revision: 113090

URL: http://llvm.org/viewvc/llvm-project?rev=113090&view=rev
Log:
make clang print types as "const int *" instead of "int const*",
which is should have done from the beginning.  As usual, the most
fun with this sort of change is updating all the testcases.

Modified:
    cfe/trunk/lib/AST/Type.cpp
    cfe/trunk/lib/AST/TypePrinter.cpp
    cfe/trunk/test/Analysis/dead-stores.c
    cfe/trunk/test/Analysis/exercise-ps.c
    cfe/trunk/test/Analysis/uninit-vals.c
    cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp
    cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
    cfe/trunk/test/CXX/dcl.decl/dcl.init/p6.cpp
    cfe/trunk/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp
    cfe/trunk/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp
    cfe/trunk/test/CXX/temp/temp.decls/temp.mem/p5.cpp
    cfe/trunk/test/Index/complete-exprs.c
    cfe/trunk/test/Rewriter/finally.m
    cfe/trunk/test/Sema/address_spaces.c
    cfe/trunk/test/Sema/array-constraint.c
    cfe/trunk/test/Sema/asm.c
    cfe/trunk/test/Sema/block-call.c
    cfe/trunk/test/Sema/block-return.c
    cfe/trunk/test/Sema/implicit-builtin-decl.c
    cfe/trunk/test/Sema/knr-def-call.c
    cfe/trunk/test/Sema/predef.c
    cfe/trunk/test/Sema/vector-assign.c
    cfe/trunk/test/Sema/warn-write-strings.c
    cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp
    cfe/trunk/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
    cfe/trunk/test/SemaCXX/builtin-ptrtomember-ambig.cpp
    cfe/trunk/test/SemaCXX/class.cpp
    cfe/trunk/test/SemaCXX/composite-pointer-type.cpp
    cfe/trunk/test/SemaCXX/const-cast.cpp
    cfe/trunk/test/SemaCXX/conversion-function.cpp
    cfe/trunk/test/SemaCXX/cstyle-cast.cpp
    cfe/trunk/test/SemaCXX/dcl_init_aggr.cpp
    cfe/trunk/test/SemaCXX/decl-init-ref.cpp
    cfe/trunk/test/SemaCXX/functional-cast.cpp
    cfe/trunk/test/SemaCXX/new-delete.cpp
    cfe/trunk/test/SemaCXX/overload-call.cpp
    cfe/trunk/test/SemaCXX/overload-member-call.cpp
    cfe/trunk/test/SemaCXX/references.cpp
    cfe/trunk/test/SemaCXX/reinterpret-cast.cpp
    cfe/trunk/test/SemaCXX/static-cast.cpp
    cfe/trunk/test/SemaObjC/conditional-expr-4.m
    cfe/trunk/test/SemaObjC/warn-write-strings.m
    cfe/trunk/test/SemaObjCXX/message.mm
    cfe/trunk/test/SemaTemplate/instantiate-expr-4.cpp
    cfe/trunk/test/SemaTemplate/instantiation-default-1.cpp

Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Sat Sep  4 19:04:01 2010
@@ -1040,7 +1040,7 @@
 }
 
 /// LookThroughTypedefs - Return the ultimate type this typedef corresponds to
-/// potentially looking through *all* consecutive typedefs.  This returns the
+/// potentially looking through *all* consequtive typedefs.  This returns the
 /// sum of the type qualifiers, so if you have:
 ///   typedef const int A;
 ///   typedef volatile A B;

Modified: cfe/trunk/lib/AST/TypePrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypePrinter.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypePrinter.cpp (original)
+++ cfe/trunk/lib/AST/TypePrinter.cpp Sat Sep  4 19:04:01 2010
@@ -66,7 +66,15 @@
   
   // Print qualifiers as appropriate.
   Qualifiers Quals = T.getLocalQualifiers();
-  if (!Quals.empty()) {
+  
+  // CanPrefixQualifiers - We prefer to print type qualifiers before the type,
+  // so that we get "const int" instead of "int const", but we can't do this if
+  // the type is complex.  For example if the type is "int*", we *must* print
+  // "int * const", printing "const int *" is different.  Only do this when the
+  // type expands to a simple string.
+  bool CanPrefixQualifiers = isa<BuiltinType>(T);
+  
+  if (!CanPrefixQualifiers && !Quals.empty()) {
     std::string TQS;
     Quals.getAsStringInternal(TQS, Policy);
     
@@ -84,6 +92,18 @@
     break;
 #include "clang/AST/TypeNodes.def"
   }
+  
+  // If we're adding the qualifiers as a prefix, do it now.
+  if (CanPrefixQualifiers && !Quals.empty()) {
+    std::string TQS;
+    Quals.getAsStringInternal(TQS, Policy);
+    
+    if (!S.empty()) {
+      TQS += ' ';
+      TQS += S;
+    }
+    std::swap(S, TQS);
+  }
 }
 
 void TypePrinter::PrintBuiltin(const BuiltinType *T, std::string &S) {

Modified: cfe/trunk/test/Analysis/dead-stores.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/dead-stores.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/dead-stores.c (original)
+++ cfe/trunk/test/Analysis/dead-stores.c Sat Sep  4 19:04:01 2010
@@ -13,7 +13,7 @@
 void f2(void *b) {
  char *c = (char*)b; // no-warning
  char *d = b+1; // expected-warning {{never read}} expected-warning{{unused variable 'd'}}
- printf("%s", c); // expected-warning{{implicitly declaring C library function 'printf' with type 'int (char const *, ...)'}} \
+ printf("%s", c); // expected-warning{{implicitly declaring C library function 'printf' with type 'int (const char *, ...)'}} \
  // expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
 }
 

Modified: cfe/trunk/test/Analysis/exercise-ps.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/exercise-ps.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/exercise-ps.c (original)
+++ cfe/trunk/test/Analysis/exercise-ps.c Sat Sep  4 19:04:01 2010
@@ -19,6 +19,6 @@
 static void f2(void *buf) {
   F12_typedef* x;
   x = f2_helper();
-  memcpy((&x[1]), (buf), 1); // expected-warning{{implicitly declaring C library function 'memcpy' with type 'void *(void *, void const *}} \
+  memcpy((&x[1]), (buf), 1); // expected-warning{{implicitly declaring C library function 'memcpy' with type 'void *(void *, const void *}} \
   // expected-note{{please include the header <string.h> or explicitly provide a declaration for 'memcpy'}}
 }

Modified: cfe/trunk/test/Analysis/uninit-vals.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/uninit-vals.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/uninit-vals.c (original)
+++ cfe/trunk/test/Analysis/uninit-vals.c Sat Sep  4 19:04:01 2010
@@ -32,7 +32,7 @@
   int x;
   for (i = 0 ; i < 10; i++)
     printf("%d",x++); // expected-warning {{use of uninitialized variable}} \
-  // expected-warning{{implicitly declaring C library function 'printf' with type 'int (char const *, ...)'}} \
+  // expected-warning{{implicitly declaring C library function 'printf' with type 'int (const char *, ...)'}} \
   // expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
 }
 

Modified: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp (original)
+++ cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp Sat Sep  4 19:04:01 2010
@@ -6,8 +6,8 @@
   // CHECK: double &rd =
   // CHECK-NEXT: DeclRefExpr
   double &rd = d;
-  // CHECK: double const &rcd =
-  // CHECK-NEXT: ImplicitCastExpr{{.*}}'double const' <NoOp>
+  // CHECK: const double &rcd =
+  // CHECK-NEXT: ImplicitCastExpr{{.*}}'const double' <NoOp>
   const double &rcd = d;
 }
 
@@ -47,7 +47,7 @@
 
 // CHECK: example3
 void example3() {
-  // CHECK: double const &rcd2 =
+  // CHECK: const double &rcd2 =
   // CHECK: ImplicitCastExpr{{.*}}<IntegralToFloating>
   const double& rcd2 = 2; 
 }

Modified: cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp (original)
+++ cfe/trunk/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp Sat Sep  4 19:04:01 2010
@@ -67,7 +67,7 @@
   volatile Base &bvr3 = bvc; // expected-error{{binding of reference to type 'Base volatile' to a value of type 'Base const volatile' drops qualifiers}}
   volatile Base &bvr4 = dvc; // expected-error{{binding of reference to type 'Base volatile' to a value of type 'Derived const volatile' drops qualifiers}}
   
-  volatile int &ir = ivc; // expected-error{{binding of reference to type 'int volatile' to a value of type 'int const volatile' drops qualifiers}}
+  volatile int &ir = ivc; // expected-error{{binding of reference to type 'volatile int' to a value of type 'const volatile int' drops qualifiers}}
 
   const volatile Base &bcvr1 = b;
   const volatile Base &bcvr2 = d;

Modified: cfe/trunk/test/CXX/dcl.decl/dcl.init/p6.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.init/p6.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.decl/dcl.init/p6.cpp (original)
+++ cfe/trunk/test/CXX/dcl.decl/dcl.init/p6.cpp Sat Sep  4 19:04:01 2010
@@ -12,5 +12,5 @@
 void test_const_default_init() {
   const NoUserDefault x1; // expected-error{{default initialization of an object of const type 'NoUserDefault const' requires a user-provided default constructor}}
   const HasUserDefault x2;
-  const int x3; // expected-error{{default initialization of an object of const type 'int const'}}
+  const int x3; // expected-error{{default initialization of an object of const type 'const int'}}
 }

Modified: cfe/trunk/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp (original)
+++ cfe/trunk/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp Sat Sep  4 19:04:01 2010
@@ -5,7 +5,7 @@
 
 // Element type cannot be:
 // - (cv) void
-volatile void ar2[10]; // expected-error {{incomplete element type 'void volatile'}}
+volatile void ar2[10]; // expected-error {{incomplete element type 'volatile void'}}
 // - a reference
 int& ar3[10]; // expected-error {{array of references}}
 // - a function type

Modified: cfe/trunk/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp Sat Sep  4 19:04:01 2010
@@ -88,19 +88,19 @@
   extern const volatile int cvi;
   void test() {
     S0<i> s0;
-    S0<ci> s0c; // expected-error{{reference binding of non-type template parameter of type 'int &' to template argument of type 'int const' ignores qualifiers}}
-    S0<vi> s0v; // expected-error{{reference binding of non-type template parameter of type 'int &' to template argument of type 'int volatile' ignores qualifiers}}
-    S0<cvi> s0cv; // expected-error{{reference binding of non-type template parameter of type 'int &' to template argument of type 'int const volatile' ignores qualifiers}}
+    S0<ci> s0c; // expected-error{{reference binding of non-type template parameter of type 'int &' to template argument of type 'const int' ignores qualifiers}}
+    S0<vi> s0v; // expected-error{{reference binding of non-type template parameter of type 'int &' to template argument of type 'volatile int' ignores qualifiers}}
+    S0<cvi> s0cv; // expected-error{{reference binding of non-type template parameter of type 'int &' to template argument of type 'const volatile int' ignores qualifiers}}
 
     S1<i> s1;
     S1<ci> s1c;
-    S1<vi> s1v; // expected-error{{reference binding of non-type template parameter of type 'int const &' to template argument of type 'int volatile' ignores qualifiers}}
-    S1<cvi> s1cv; // expected-error{{reference binding of non-type template parameter of type 'int const &' to template argument of type 'int const volatile' ignores qualifiers}}
+    S1<vi> s1v; // expected-error{{reference binding of non-type template parameter of type 'const int &' to template argument of type 'volatile int' ignores qualifiers}}
+    S1<cvi> s1cv; // expected-error{{reference binding of non-type template parameter of type 'const int &' to template argument of type 'const volatile int' ignores qualifiers}}
 
     S2<i> s2;
-    S2<ci> s2c; // expected-error{{reference binding of non-type template parameter of type 'int volatile &' to template argument of type 'int const' ignores qualifiers}}
+    S2<ci> s2c; // expected-error{{reference binding of non-type template parameter of type 'volatile int &' to template argument of type 'const int' ignores qualifiers}}
     S2<vi> s2v;
-    S2<cvi> s2cv; // expected-error{{reference binding of non-type template parameter of type 'int volatile &' to template argument of type 'int const volatile' ignores qualifiers}}
+    S2<cvi> s2cv; // expected-error{{reference binding of non-type template parameter of type 'volatile int &' to template argument of type 'const volatile int' ignores qualifiers}}
 
     S3<i> s3;
     S3<ci> s3c;

Modified: cfe/trunk/test/CXX/temp/temp.decls/temp.mem/p5.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CXX/temp/temp.decls/temp.mem/p5.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/CXX/temp/temp.decls/temp.mem/p5.cpp (original)
+++ cfe/trunk/test/CXX/temp/temp.decls/temp.mem/p5.cpp Sat Sep  4 19:04:01 2010
@@ -67,8 +67,8 @@
   }
 };
 
-template X0::operator const char*() const; // expected-note{{'X0::operator char const *<char>' requested here}}
-template X0::operator const int*(); // expected-note{{'X0::operator int const *<int const>' requested here}}
+template X0::operator const char*() const; // expected-note{{'X0::operator const char *<char>' requested here}}
+template X0::operator const int*(); // expected-note{{'X0::operator const int *<const int>' requested here}}
 template X0::operator float*() const; // expected-error{{explicit instantiation of undefined function template}}
 
 void test_X0(X0 x0, const X0 &x0c) {

Modified: cfe/trunk/test/Index/complete-exprs.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/complete-exprs.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Index/complete-exprs.c (original)
+++ cfe/trunk/test/Index/complete-exprs.c Sat Sep  4 19:04:01 2010
@@ -48,6 +48,6 @@
 // CHECK-CC4: VarDecl:{ResultType struct X}{TypedText f1} (50) (deprecated)
 
 // RUN: c-index-test -code-completion-at=%s:19:3 -Xclang -code-completion-patterns %s | FileCheck -check-prefix=CHECK-CC6 %s
-// CHECK-CC6: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder char const *, ...}{Text , NULL}{RightParen )} (45)
+// CHECK-CC6: FunctionDecl:{ResultType void}{TypedText f3}{LeftParen (}{Placeholder const char *, ...}{Text , NULL}{RightParen )} (45)
 // CHECK-CC6: NotImplemented:{TypedText void} (65)
 // CHECK-CC6: NotImplemented:{TypedText volatile} (65)

Modified: cfe/trunk/test/Rewriter/finally.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Rewriter/finally.m?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Rewriter/finally.m (original)
+++ cfe/trunk/test/Rewriter/finally.m Sat Sep  4 19:04:01 2010
@@ -2,7 +2,7 @@
 
 int main() {
   @try {
-    printf("executing try"); // expected-warning{{implicitly declaring C library function 'printf' with type 'int (char const *, ...)'}} \
+    printf("executing try"); // expected-warning{{implicitly declaring C library function 'printf' with type 'int (const char *, ...)'}} \
         // expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
     return(0); // expected-warning{{rewriter doesn't support user-specified control flow semantics for @try/@finally (code may not execute properly)}}
   } @finally {

Modified: cfe/trunk/test/Sema/address_spaces.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/address_spaces.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Sema/address_spaces.c (original)
+++ cfe/trunk/test/Sema/address_spaces.c Sat Sep  4 19:04:01 2010
@@ -37,6 +37,6 @@
 __attribute__((address_space(256))) void * * const base = 0;
 void * get_0(void) {
   return base[0];  // expected-error {{illegal implicit conversion between two pointers with different address spaces}} \
-                      expected-warning {{returning 'void __attribute__((address_space(256))) *' from a function with result type 'void *' discards qualifiers}}
+                      expected-warning {{returning '__attribute__((address_space(256))) void *' from a function with result type 'void *' discards qualifiers}}
 }
 

Modified: cfe/trunk/test/Sema/array-constraint.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/array-constraint.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Sema/array-constraint.c (original)
+++ cfe/trunk/test/Sema/array-constraint.c Sat Sep  4 19:04:01 2010
@@ -46,7 +46,7 @@
 void strFunc(char *); // expected-note{{passing argument to parameter here}}
 const char staticAry[] = "test";
 void checkStaticAry() { 
-  strFunc(staticAry); // expected-warning{{passing 'char const [5]' to parameter of type 'char *' discards qualifiers}}
+  strFunc(staticAry); // expected-warning{{passing 'const char [5]' to parameter of type 'char *' discards qualifiers}}
 }
 
 

Modified: cfe/trunk/test/Sema/asm.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/asm.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Sema/asm.c (original)
+++ cfe/trunk/test/Sema/asm.c Sat Sep  4 19:04:01 2010
@@ -36,7 +36,7 @@
 // <rdar://problem/6156893>
 void test4(const volatile void *addr)
 {
-    asm ("nop" : : "r"(*addr)); // expected-error {{invalid type 'void const volatile' in asm input for constraint 'r'}}
+    asm ("nop" : : "r"(*addr)); // expected-error {{invalid type 'const volatile void' in asm input for constraint 'r'}}
     asm ("nop" : : "m"(*addr));
 
     asm ("nop" : : "r"(test4(addr))); // expected-error {{invalid type 'void' in asm input for constraint 'r'}}

Modified: cfe/trunk/test/Sema/block-call.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-call.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-call.c (original)
+++ cfe/trunk/test/Sema/block-call.c Sat Sep  4 19:04:01 2010
@@ -13,7 +13,7 @@
   int (^IFP) () = PFR; // OK
 
 
-  const int (^CIC) () = IFP; // expected-error {{incompatible block pointer types initializing 'int const (^)()' with an expression of type 'int (^)()'}}
+  const int (^CIC) () = IFP; // expected-error {{incompatible block pointer types initializing 'const int (^)()' with an expression of type 'int (^)()'}}
 
   const int (^CICC) () = CIC;
 

Modified: cfe/trunk/test/Sema/block-return.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/block-return.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Sema/block-return.c (original)
+++ cfe/trunk/test/Sema/block-return.c Sat Sep  4 19:04:01 2010
@@ -78,10 +78,10 @@
 }
 void next();
 void foo4() {
-  int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(char const *)' with an expression of type 'int (^)(char *)'}}
-  int (*yy)(const char *s) = funk; // expected-warning {{incompatible pointer types initializing 'int (*)(char const *)' with an expression of type 'int (char *)'}}
+  int (^xx)(const char *s) = ^(char *s) { return 1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(const char *)' with an expression of type 'int (^)(char *)'}}
+  int (*yy)(const char *s) = funk; // expected-warning {{incompatible pointer types initializing 'int (*)(const char *)' with an expression of type 'int (char *)'}}
   
-  int (^nested)(char *s) = ^(char *str) { void (^nest)(void) = ^(void) { printf("%s\n", str); }; next(); return 1; }; // expected-warning{{implicitly declaring C library function 'printf' with type 'int (char const *, ...)'}} \
+  int (^nested)(char *s) = ^(char *str) { void (^nest)(void) = ^(void) { printf("%s\n", str); }; next(); return 1; }; // expected-warning{{implicitly declaring C library function 'printf' with type 'int (const char *, ...)'}} \
   // expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
 }
 
@@ -109,7 +109,7 @@
 
 void foo7()
 {
- const int (^BB) (void) = ^{ const int i = 1; return i; }; // expected-error{{incompatible block pointer types initializing 'int const (^)(void)' with an expression of type 'int (^)(void)'}}
+ const int (^BB) (void) = ^{ const int i = 1; return i; }; // expected-error{{incompatible block pointer types initializing 'const int (^)(void)' with an expression of type 'int (^)(void)'}}
 
  const int (^CC) (void)  = ^const int{ const int i = 1; return i; };
 

Modified: cfe/trunk/test/Sema/implicit-builtin-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/implicit-builtin-decl.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Sema/implicit-builtin-decl.c (original)
+++ cfe/trunk/test/Sema/implicit-builtin-decl.c Sat Sep  4 19:04:01 2010
@@ -18,7 +18,7 @@
 void h() {
   int malloc(int); // expected-warning{{incompatible redeclaration of library function 'malloc'}}
   int strcpy(int); // expected-warning{{incompatible redeclaration of library function 'strcpy'}} \
-  // expected-note{{'strcpy' is a builtin with type 'char *(char *, char const *)'}}
+  // expected-note{{'strcpy' is a builtin with type 'char *(char *, const char *)'}}
 }
 
 void f2() {

Modified: cfe/trunk/test/Sema/knr-def-call.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/knr-def-call.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Sema/knr-def-call.c (original)
+++ cfe/trunk/test/Sema/knr-def-call.c Sat Sep  4 19:04:01 2010
@@ -23,7 +23,7 @@
 }
 
 char *rindex(s, c)
-     register char *s, c; // expected-warning{{promoted type 'char *' of K&R function parameter is not compatible with the parameter type 'char const *' declared in a previous prototype}}
+     register char *s, c; // expected-warning{{promoted type 'char *' of K&R function parameter is not compatible with the parameter type 'const char *' declared in a previous prototype}}
 {
   return 0;
 }

Modified: cfe/trunk/test/Sema/predef.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/predef.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Sema/predef.c (original)
+++ cfe/trunk/test/Sema/predef.c Sat Sep  4 19:04:01 2010
@@ -6,7 +6,7 @@
 }
 
 char *X = __func__; // expected-warning {{predefined identifier is only valid}} \
-                       expected-warning {{initializing 'char *' with an expression of type 'char const [1]' discards qualifiers}}
+                       expected-warning {{initializing 'char *' with an expression of type 'const char [1]' discards qualifiers}}
 
 void a() {
   __func__[0] = 'a';  // expected-error {{variable is not assignable}}

Modified: cfe/trunk/test/Sema/vector-assign.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/vector-assign.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Sema/vector-assign.c (original)
+++ cfe/trunk/test/Sema/vector-assign.c Sat Sep  4 19:04:01 2010
@@ -49,5 +49,5 @@
 
 void test3a(longlongvec *); // expected-note{{passing argument to parameter here}}
 void test3(const unsigned *src) {
-  test3a(src);  // expected-warning {{incompatible pointer types passing 'unsigned int const *' to parameter of type 'longlongvec *'}}
+  test3a(src);  // expected-warning {{incompatible pointer types passing 'const unsigned int *' to parameter of type 'longlongvec *'}}
 }

Modified: cfe/trunk/test/Sema/warn-write-strings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-write-strings.c?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-write-strings.c (original)
+++ cfe/trunk/test/Sema/warn-write-strings.c Sat Sep  4 19:04:01 2010
@@ -1,4 +1,4 @@
 // RUN: %clang_cc1 -verify -fsyntax-only -Wwrite-strings %s
 
 // PR4804
-char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'char const [4]' discards qualifiers}}
+char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'const char [4]' discards qualifiers}}

Modified: cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp (original)
+++ cfe/trunk/test/SemaCXX/ambig-user-defined-conversions.cpp Sat Sep  4 19:04:01 2010
@@ -20,7 +20,7 @@
   const int Test1() {
 
     func(b1, f()); // expected-error {{call to 'func' is ambiguous}}
-    return f(); // expected-error {{conversion from 'test0::B' to 'int const' is ambiguous}}
+    return f(); // expected-error {{conversion from 'test0::B' to 'const int' is ambiguous}}
   }
 
   // This used to crash when comparing the two operands.

Modified: cfe/trunk/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/ambiguous-builtin-unary-operator.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/ambiguous-builtin-unary-operator.cpp (original)
+++ cfe/trunk/test/SemaCXX/ambiguous-builtin-unary-operator.cpp Sat Sep  4 19:04:01 2010
@@ -28,7 +28,7 @@
 
 void test(C1 c) {
   ++c;	// expected-error {{use of overloaded operator '++' is ambiguous}} \
-	// expected-note {{built-in candidate operator++(int volatile &)}} \
-	// expected-note {{built-in candidate operator++(long volatile &)}}
+	// expected-note {{built-in candidate operator++(volatile int &)}} \
+	// expected-note {{built-in candidate operator++(volatile long &)}}
 }
 

Modified: cfe/trunk/test/SemaCXX/builtin-ptrtomember-ambig.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/builtin-ptrtomember-ambig.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/builtin-ptrtomember-ambig.cpp (original)
+++ cfe/trunk/test/SemaCXX/builtin-ptrtomember-ambig.cpp Sat Sep  4 19:04:01 2010
@@ -19,9 +19,9 @@
 void foo(C c, int A::* pmf) {
        				// FIXME. Why so many built-in candidates?
 	int i = c->*pmf; 	// expected-error {{use of overloaded operator '->*' is ambiguous}} \
-				// expected-note {{built-in candidate operator->*(struct A const *, int const struct A::*)}} \
+				// expected-note {{built-in candidate operator->*(struct A const *, const int struct A::*)}} \
 				// expected-note {{built-in candidate operator->*(struct A const *, int struct A::*)}} \
-				// expected-note {{built-in candidate operator->*(struct A *, int const struct A::*)}} \
+				// expected-note {{built-in candidate operator->*(struct A *, const int struct A::*)}} \
 				// expected-note {{built-in candidate operator->*(struct A *, int struct A::*)}}
 }
 

Modified: cfe/trunk/test/SemaCXX/class.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/class.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/class.cpp (original)
+++ cfe/trunk/test/SemaCXX/class.cpp Sat Sep  4 19:04:01 2010
@@ -89,7 +89,7 @@
 void f()
 {
   const C3 c3 = { 1, 2 };
-  (void)static_cast<int*>(&c3.i); // expected-error {{static_cast from 'int const *' to 'int *' is not allowed}}
+  (void)static_cast<int*>(&c3.i); // expected-error {{static_cast from 'const int *' to 'int *' is not allowed}}
   // but no error here
   (void)static_cast<int*>(&c3.j);
 }

Modified: cfe/trunk/test/SemaCXX/composite-pointer-type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/composite-pointer-type.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/composite-pointer-type.cpp (original)
+++ cfe/trunk/test/SemaCXX/composite-pointer-type.cpp Sat Sep  4 19:04:01 2010
@@ -53,8 +53,8 @@
 
 // PR6346
 bool f1(bool b, void **p, const void **q) {
-  if (p == q) // expected-warning{{comparison of distinct pointer types ('void **' and 'void const **') uses non-standard composite pointer type 'void const *const *'}}
+  if (p == q) // expected-warning{{comparison of distinct pointer types ('void **' and 'const void **') uses non-standard composite pointer type 'const void *const *'}}
     return false;
 
-  return b? p : q; // expected-warning{{incompatible operand types ('void **' and 'void const **') use non-standard composite pointer type 'void const *const *'}}
+  return b? p : q; // expected-warning{{incompatible operand types ('void **' and 'const void **') use non-standard composite pointer type 'const void *const *'}}
 }

Modified: cfe/trunk/test/SemaCXX/const-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/const-cast.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/const-cast.cpp (original)
+++ cfe/trunk/test/SemaCXX/const-cast.cpp Sat Sep  4 19:04:01 2010
@@ -45,16 +45,16 @@
 short *bad_const_cast_test(char const *volatile *const volatile *var)
 {
   // Different pointer levels.
-  char **var2 = const_cast<char**>(var); // expected-error {{const_cast from 'char const *volatile *const volatile *' to 'char **' is not allowed}}
+  char **var2 = const_cast<char**>(var); // expected-error {{const_cast from 'const char *volatile *const volatile *' to 'char **' is not allowed}}
   // Different final type.
-  short ***var3 = const_cast<short***>(var); // expected-error {{const_cast from 'char const *volatile *const volatile *' to 'short ***' is not allowed}}
+  short ***var3 = const_cast<short***>(var); // expected-error {{const_cast from 'const char *volatile *const volatile *' to 'short ***' is not allowed}}
   // Rvalue to reference.
   char ***&var4 = const_cast<cpppr>(&var2); // expected-error {{const_cast from rvalue to reference type 'cpppr'}}
   // Non-pointer.
   char v = const_cast<char>(**var2); // expected-error {{const_cast to 'char', which is not a reference, pointer-to-object, or pointer-to-data-member}}
   const int *ar[100] = {0};
   // Not even lenient g++ accepts this.
-  int *(*rar)[100] = const_cast<int *(*)[100]>(&ar); // expected-error {{const_cast from 'int const *(*)[100]' to 'int *(*)[100]' is not allowed}}
+  int *(*rar)[100] = const_cast<int *(*)[100]>(&ar); // expected-error {{const_cast from 'const int *(*)[100]' to 'int *(*)[100]' is not allowed}}
   f fp1 = 0;
   // Function pointers.
   f fp2 = const_cast<f>(fp1); // expected-error {{const_cast to 'f' (aka 'int (*)(int)'), which is not a reference, pointer-to-object, or pointer-to-data-member}}

Modified: cfe/trunk/test/SemaCXX/conversion-function.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/conversion-function.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/conversion-function.cpp (original)
+++ cfe/trunk/test/SemaCXX/conversion-function.cpp Sat Sep  4 19:04:01 2010
@@ -50,7 +50,7 @@
 class B : public A {
 public:
   operator A&() const; // expected-warning{{conversion function converting 'B' to its base class 'A' will never be used}}
-  operator const void() const; // expected-warning{{conversion function converting 'B' to 'void const' will never be used}}
+  operator const void() const; // expected-warning{{conversion function converting 'B' to 'const void' will never be used}}
   operator const B(); // expected-warning{{conversion function converting 'B' to itself will never be used}}
 };
 

Modified: cfe/trunk/test/SemaCXX/cstyle-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/cstyle-cast.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/cstyle-cast.cpp (original)
+++ cfe/trunk/test/SemaCXX/cstyle-cast.cpp Sat Sep  4 19:04:01 2010
@@ -226,6 +226,6 @@
   void (structure::*psf)() = 0;
   (void)(int (structure::*)())(psf);
 
-  (void)(void (structure::*)())(psi); // expected-error {{C-style cast from 'int const structure::*' to 'void (structure::*)()' is not allowed}}
+  (void)(void (structure::*)())(psi); // expected-error {{C-style cast from 'const int structure::*' to 'void (structure::*)()' is not allowed}}
   (void)(int structure::*)(psf); // expected-error {{C-style cast from 'void (structure::*)()' to 'int structure::*' is not allowed}}
 }

Modified: cfe/trunk/test/SemaCXX/dcl_init_aggr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/dcl_init_aggr.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/dcl_init_aggr.cpp (original)
+++ cfe/trunk/test/SemaCXX/dcl_init_aggr.cpp Sat Sep  4 19:04:01 2010
@@ -120,4 +120,4 @@
 u u2 = u1; 
 u u3 = 1; // expected-error{{no viable conversion}}
 u u4 = { 0, "asdf" };  // expected-error{{excess elements in union initializer}}
-u u5 = { "asdf" }; // expected-error{{cannot initialize a member subobject of type 'int' with an lvalue of type 'char const [5]'}}
+u u5 = { "asdf" }; // expected-error{{cannot initialize a member subobject of type 'int' with an lvalue of type 'const char [5]'}}

Modified: cfe/trunk/test/SemaCXX/decl-init-ref.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/decl-init-ref.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/decl-init-ref.cpp (original)
+++ cfe/trunk/test/SemaCXX/decl-init-ref.cpp Sat Sep  4 19:04:01 2010
@@ -18,7 +18,7 @@
 
 extern B f();
 
-const int& ri = (void)0; // expected-error {{reference to type 'int const' could not bind to an rvalue of type 'void'}}
+const int& ri = (void)0; // expected-error {{reference to type 'const int' could not bind to an rvalue of type 'void'}}
 
 int main() {
         const A& rca = f(); // expected-error {{reference initialization of type 'A const &' with initializer of type 'B' is ambiguous}}

Modified: cfe/trunk/test/SemaCXX/functional-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/functional-cast.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/functional-cast.cpp (original)
+++ cfe/trunk/test/SemaCXX/functional-cast.cpp Sat Sep  4 19:04:01 2010
@@ -304,7 +304,7 @@
   (void)structureimfp(psf);
 
   typedef void (structure::*structurevmfp)();
-  (void)structurevmfp(psi); // expected-error {{functional-style cast from 'int const structure::*' to 'structurevmfp' (aka 'void (structure::*)()') is not allowed}}
+  (void)structurevmfp(psi); // expected-error {{functional-style cast from 'const int structure::*' to 'structurevmfp' (aka 'void (structure::*)()') is not allowed}}
   (void)structureimp(psf); // expected-error {{functional-style cast from 'void (structure::*)()' to 'structureimp' (aka 'int structure::*') is not allowed}}
 }
 

Modified: cfe/trunk/test/SemaCXX/new-delete.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/new-delete.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/new-delete.cpp (original)
+++ cfe/trunk/test/SemaCXX/new-delete.cpp Sat Sep  4 19:04:01 2010
@@ -73,7 +73,7 @@
   (void)new int(1, 2); // expected-error {{excess elements in scalar initializer}}
   (void)new S(1); // expected-error {{no matching constructor}}
   (void)new S(1, 1); // expected-error {{call to constructor of 'S' is ambiguous}}
-  (void)new const int; // expected-error {{default initialization of an object of const type 'int const'}}
+  (void)new const int; // expected-error {{default initialization of an object of const type 'const int'}}
   (void)new float*(ip); // expected-error {{cannot initialize a new value of type 'float *' with an lvalue of type 'int *'}}
   // Undefined, but clang should reject it directly.
   (void)new int[-1]; // expected-error {{array size is negative}}

Modified: cfe/trunk/test/SemaCXX/overload-call.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/overload-call.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/overload-call.cpp (original)
+++ cfe/trunk/test/SemaCXX/overload-call.cpp Sat Sep  4 19:04:01 2010
@@ -317,8 +317,8 @@
 
 // Tests the exact text used to note the candidates
 namespace test1 {
-  template <class T> void foo(T t, unsigned N); // expected-note {{candidate function [with T = int] not viable: no known conversion from 'char const [6]' to 'unsigned int' for 2nd argument}}
-  void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'char const [6]' to 'char' for 2nd argument}} 
+  template <class T> void foo(T t, unsigned N); // expected-note {{candidate function [with T = int] not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}}
+  void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'char' for 2nd argument}} 
   void foo(int n); // expected-note {{candidate function not viable: requires 1 argument, but 2 were provided}}
   void foo(unsigned n = 10); // expected-note {{candidate function not viable: requires at most 1 argument, but 2 were provided}}
   void foo(int n, const char *s, int t); // expected-note {{candidate function not viable: requires 3 arguments, but 2 were provided}}
@@ -441,7 +441,7 @@
   void f(bool const volatile&); // expected-note{{passing argument to parameter here}}
   void f(String);
 
-  void g() { f(""); } // expected-error{{volatile lvalue reference to type 'bool const volatile' cannot bind to a value of unrelated type 'char const [1]'}}
+  void g() { f(""); } // expected-error{{volatile lvalue reference to type 'const volatile bool' cannot bind to a value of unrelated type 'const char [1]'}}
 }
 
 namespace PR7095 {

Modified: cfe/trunk/test/SemaCXX/overload-member-call.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/overload-member-call.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/overload-member-call.cpp (original)
+++ cfe/trunk/test/SemaCXX/overload-member-call.cpp Sat Sep  4 19:04:01 2010
@@ -70,8 +70,8 @@
 // Tests the exact text used to note the candidates
 namespace test1 {
   class A {
-    template <class T> void foo(T t, unsigned N); // expected-note {{candidate function [with T = int] not viable: no known conversion from 'char const [6]' to 'unsigned int' for 2nd argument}}
-    void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'char const [6]' to 'char' for 2nd argument}} 
+    template <class T> void foo(T t, unsigned N); // expected-note {{candidate function [with T = int] not viable: no known conversion from 'const char [6]' to 'unsigned int' for 2nd argument}}
+    void foo(int n, char N); // expected-note {{candidate function not viable: no known conversion from 'const char [6]' to 'char' for 2nd argument}} 
     void foo(int n); // expected-note {{candidate function not viable: requires 1 argument, but 2 were provided}}
     void foo(unsigned n = 10); // expected-note {{candidate function not viable: requires at most 1 argument, but 2 were provided}}
     void foo(int n, const char *s, int t); // expected-note {{candidate function not viable: requires 3 arguments, but 2 were provided}}

Modified: cfe/trunk/test/SemaCXX/references.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/references.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/references.cpp (original)
+++ cfe/trunk/test/SemaCXX/references.cpp Sat Sep  4 19:04:01 2010
@@ -54,7 +54,7 @@
 void test5() {
   //  const double& rcd2 = 2; // rcd2 refers to temporary with value 2.0
   const volatile int cvi = 1;
-  const int& r = cvi; // expected-error{{binding of reference to type 'int const' to a value of type 'int const volatile' drops qualifiers}}
+  const int& r = cvi; // expected-error{{binding of reference to type 'const int' to a value of type 'const volatile int' drops qualifiers}}
 }
 
 // C++ [dcl.init.ref]p3

Modified: cfe/trunk/test/SemaCXX/reinterpret-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/reinterpret-cast.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/reinterpret-cast.cpp (original)
+++ cfe/trunk/test/SemaCXX/reinterpret-cast.cpp Sat Sep  4 19:04:01 2010
@@ -45,9 +45,9 @@
   // Valid: T1* -> T2 const*
   int const *icp = reinterpret_cast<int const*>(ipppc);
   // Invalid: T1 const* -> T2*
-  (void)reinterpret_cast<int*>(icp); // expected-error {{reinterpret_cast from 'int const *' to 'int *' casts away constness}}
+  (void)reinterpret_cast<int*>(icp); // expected-error {{reinterpret_cast from 'const int *' to 'int *' casts away constness}}
   // Invalid: T1*** -> T2 const* const**
-  int const *const **icpcpp = reinterpret_cast<int const* const**>(ipppc); // expected-error {{reinterpret_cast from 'int ***' to 'int const *const **' casts away constness}}
+  int const *const **icpcpp = reinterpret_cast<int const* const**>(ipppc); // expected-error {{reinterpret_cast from 'int ***' to 'const int *const **' casts away constness}}
   // Valid: T1* -> T2*
   int *ip = reinterpret_cast<int*>(icpcpp);
   // Valid: T* -> T const*
@@ -77,12 +77,12 @@
 {
   const int structure::*psi = 0;
   (void)reinterpret_cast<const float structure::*>(psi);
-  (void)reinterpret_cast<int structure::*>(psi); // expected-error {{reinterpret_cast from 'int const structure::*' to 'int structure::*' casts away constness}}
+  (void)reinterpret_cast<int structure::*>(psi); // expected-error {{reinterpret_cast from 'const int structure::*' to 'int structure::*' casts away constness}}
 
   void (structure::*psf)() = 0;
   (void)reinterpret_cast<int (structure::*)()>(psf);
 
-  (void)reinterpret_cast<void (structure::*)()>(psi); // expected-error {{reinterpret_cast from 'int const structure::*' to 'void (structure::*)()' is not allowed}}
+  (void)reinterpret_cast<void (structure::*)()>(psi); // expected-error {{reinterpret_cast from 'const int structure::*' to 'void (structure::*)()' is not allowed}}
   (void)reinterpret_cast<int structure::*>(psf); // expected-error {{reinterpret_cast from 'void (structure::*)()' to 'int structure::*' is not allowed}}
 
   // Cannot cast from integers to member pointers, not even the null pointer

Modified: cfe/trunk/test/SemaCXX/static-cast.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/static-cast.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/static-cast.cpp (original)
+++ cfe/trunk/test/SemaCXX/static-cast.cpp Sat Sep  4 19:04:01 2010
@@ -55,7 +55,7 @@
 
   // Bad code below
 
-  (void)static_cast<void*>((const int*)0); // expected-error {{static_cast from 'int const *' to 'void *' is not allowed}}
+  (void)static_cast<void*>((const int*)0); // expected-error {{static_cast from 'const int *' to 'void *' is not allowed}}
   (void)static_cast<A*>((E*)0); // expected-error {{cannot cast 'E' to its private base class 'A'}}
   (void)static_cast<A*>((H*)0); // expected-error {{ambiguous conversion}}
   (void)static_cast<int>((int*)0); // expected-error {{static_cast from 'int *' to 'int' is not allowed}}
@@ -119,7 +119,7 @@
 
   // Bad code below
 
-  (void)static_cast<int*>((const void*)0); // expected-error {{static_cast from 'void const *' to 'int *' casts away constness}}
+  (void)static_cast<int*>((const void*)0); // expected-error {{static_cast from 'const void *' to 'int *' casts away constness}}
   (void)static_cast<void (*)()>((void*)0); // expected-error {{static_cast from 'void *' to 'void (*)()' is not allowed}}
 }
 

Modified: cfe/trunk/test/SemaObjC/conditional-expr-4.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/conditional-expr-4.m?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/conditional-expr-4.m (original)
+++ cfe/trunk/test/SemaObjC/conditional-expr-4.m Sat Sep  4 19:04:01 2010
@@ -26,7 +26,7 @@
 }
 
 void *f1_const_a(int x, void *p, const A * q) {
-  void *r = x ? p : q; // expected-warning{{initializing 'void *' with an expression of type 'void const *' discards qualifiers}}
+  void *r = x ? p : q; // expected-warning{{initializing 'void *' with an expression of type 'const void *' discards qualifiers}}
   return r;
 }
 

Modified: cfe/trunk/test/SemaObjC/warn-write-strings.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/warn-write-strings.m?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/warn-write-strings.m (original)
+++ cfe/trunk/test/SemaObjC/warn-write-strings.m Sat Sep  4 19:04:01 2010
@@ -1,4 +1,4 @@
 // RUN: %clang_cc1 -verify -fsyntax-only -Wwrite-strings %s
 
 // PR4804
-char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'char const [4]' discards qualifiers}}
+char* x = "foo"; // expected-warning {{initializing 'char *' with an expression of type 'const char [4]' discards qualifiers}}

Modified: cfe/trunk/test/SemaObjCXX/message.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjCXX/message.mm?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjCXX/message.mm (original)
+++ cfe/trunk/test/SemaObjCXX/message.mm Sat Sep  4 19:04:01 2010
@@ -90,5 +90,5 @@
 
 void test_I5(I5 *i5, String s) {
   [i5 method:"hello" other:s];
-  [i5 method:s other:"world"]; // expected-error{{non-const lvalue reference to type 'String' cannot bind to a value of unrelated type 'char const [6]'}}
+  [i5 method:s other:"world"]; // expected-error{{non-const lvalue reference to type 'String' cannot bind to a value of unrelated type 'const char [6]'}}
 }

Modified: cfe/trunk/test/SemaTemplate/instantiate-expr-4.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiate-expr-4.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiate-expr-4.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiate-expr-4.cpp Sat Sep  4 19:04:01 2010
@@ -319,7 +319,7 @@
 template<typename T>
 struct QualifiedDeclRef0 {
   T f() {
-    return is_pod<X>::value; // expected-error{{non-const lvalue reference to type 'int' cannot bind to a value of unrelated type 'bool const'}}
+    return is_pod<X>::value; // expected-error{{non-const lvalue reference to type 'int' cannot bind to a value of unrelated type 'const bool'}}
   }
 };
 

Modified: cfe/trunk/test/SemaTemplate/instantiation-default-1.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaTemplate/instantiation-default-1.cpp?rev=113090&r1=113089&r2=113090&view=diff
==============================================================================
--- cfe/trunk/test/SemaTemplate/instantiation-default-1.cpp (original)
+++ cfe/trunk/test/SemaTemplate/instantiation-default-1.cpp Sat Sep  4 19:04:01 2010
@@ -36,7 +36,7 @@
 Def2<int_ref_t> *d2; // expected-note{{in instantiation of default argument for 'Def2<int &>' required here}}
 
 
-template<> struct Def1<const int, const int> { }; // expected-error{{redefinition of 'Def1<int const>'}}
+template<> struct Def1<const int, const int> { }; // expected-error{{redefinition of 'Def1<const int>'}}
 
 template<typename T, typename T2 = T&> struct Def3;
 





More information about the cfe-commits mailing list