aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-05 00:04:01 +0000
committerChris Lattner <sabre@nondot.org>2010-09-05 00:04:01 +0000
commit58f9e13e87e57236fee4b914eea9be6f92a1c345 (patch)
tree9002ed9afacc02f28bce930a861d0a4260772938
parent59742de0f9d4fbd421b69ed0c1b6c7a6d83339fb (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113090 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/Type.cpp2
-rw-r--r--lib/AST/TypePrinter.cpp22
-rw-r--r--test/Analysis/dead-stores.c2
-rw-r--r--test/Analysis/exercise-ps.c2
-rw-r--r--test/Analysis/uninit-vals.c2
-rw-r--r--test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp6
-rw-r--r--test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp2
-rw-r--r--test/CXX/dcl.decl/dcl.init/p6.cpp2
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp2
-rw-r--r--test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp14
-rw-r--r--test/CXX/temp/temp.decls/temp.mem/p5.cpp4
-rw-r--r--test/Index/complete-exprs.c2
-rw-r--r--test/Rewriter/finally.m2
-rw-r--r--test/Sema/address_spaces.c2
-rw-r--r--test/Sema/array-constraint.c2
-rw-r--r--test/Sema/asm.c2
-rw-r--r--test/Sema/block-call.c2
-rw-r--r--test/Sema/block-return.c8
-rw-r--r--test/Sema/implicit-builtin-decl.c2
-rw-r--r--test/Sema/knr-def-call.c2
-rw-r--r--test/Sema/predef.c2
-rw-r--r--test/Sema/vector-assign.c2
-rw-r--r--test/Sema/warn-write-strings.c2
-rw-r--r--test/SemaCXX/ambig-user-defined-conversions.cpp2
-rw-r--r--test/SemaCXX/ambiguous-builtin-unary-operator.cpp4
-rw-r--r--test/SemaCXX/builtin-ptrtomember-ambig.cpp4
-rw-r--r--test/SemaCXX/class.cpp2
-rw-r--r--test/SemaCXX/composite-pointer-type.cpp4
-rw-r--r--test/SemaCXX/const-cast.cpp6
-rw-r--r--test/SemaCXX/conversion-function.cpp2
-rw-r--r--test/SemaCXX/cstyle-cast.cpp2
-rw-r--r--test/SemaCXX/dcl_init_aggr.cpp2
-rw-r--r--test/SemaCXX/decl-init-ref.cpp2
-rw-r--r--test/SemaCXX/functional-cast.cpp2
-rw-r--r--test/SemaCXX/new-delete.cpp2
-rw-r--r--test/SemaCXX/overload-call.cpp6
-rw-r--r--test/SemaCXX/overload-member-call.cpp4
-rw-r--r--test/SemaCXX/references.cpp2
-rw-r--r--test/SemaCXX/reinterpret-cast.cpp8
-rw-r--r--test/SemaCXX/static-cast.cpp4
-rw-r--r--test/SemaObjC/conditional-expr-4.m2
-rw-r--r--test/SemaObjC/warn-write-strings.m2
-rw-r--r--test/SemaObjCXX/message.mm2
-rw-r--r--test/SemaTemplate/instantiate-expr-4.cpp2
-rw-r--r--test/SemaTemplate/instantiation-default-1.cpp2
45 files changed, 89 insertions, 69 deletions
diff --git a/lib/AST/Type.cpp b/lib/AST/Type.cpp
index ccd26f8ba2..ca10532e72 100644
--- a/lib/AST/Type.cpp
+++ b/lib/AST/Type.cpp
@@ -1040,7 +1040,7 @@ void FunctionProtoType::Profile(llvm::FoldingSetNodeID &ID) {
}
/// 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;
diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp
index d3a6b64553..e21f9ac3ae 100644
--- a/lib/AST/TypePrinter.cpp
+++ b/lib/AST/TypePrinter.cpp
@@ -66,7 +66,15 @@ void TypePrinter::Print(QualType T, std::string &S) {
// 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 @@ void TypePrinter::Print(QualType T, std::string &S) {
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) {
diff --git a/test/Analysis/dead-stores.c b/test/Analysis/dead-stores.c
index 57d5d112d7..da131a2982 100644
--- a/test/Analysis/dead-stores.c
+++ b/test/Analysis/dead-stores.c
@@ -13,7 +13,7 @@ void f1() {
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'}}
}
diff --git a/test/Analysis/exercise-ps.c b/test/Analysis/exercise-ps.c
index 0a95b70556..196b67936a 100644
--- a/test/Analysis/exercise-ps.c
+++ b/test/Analysis/exercise-ps.c
@@ -19,6 +19,6 @@ void_typedef f2_helper();
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'}}
}
diff --git a/test/Analysis/uninit-vals.c b/test/Analysis/uninit-vals.c
index b0769ba6bc..e4395e8486 100644
--- a/test/Analysis/uninit-vals.c
+++ b/test/Analysis/uninit-vals.c
@@ -32,7 +32,7 @@ void f6(int i) {
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'}}
}
diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp
index 9b3925969c..b50bcb9aec 100644
--- a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp
+++ b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp
@@ -6,8 +6,8 @@ void example0() {
// 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 @@ void example2() {
// CHECK: example3
void example3() {
- // CHECK: double const &rcd2 =
+ // CHECK: const double &rcd2 =
// CHECK: ImplicitCastExpr{{.*}}<IntegralToFloating>
const double& rcd2 = 2;
}
diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
index 6a039b93eb..382488a9b6 100644
--- a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
+++ b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
@@ -67,7 +67,7 @@ void bind_lvalue_quals(volatile Base b, volatile Derived d,
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;
diff --git a/test/CXX/dcl.decl/dcl.init/p6.cpp b/test/CXX/dcl.decl/dcl.init/p6.cpp
index c542dac1db..7767761b1d 100644
--- a/test/CXX/dcl.decl/dcl.init/p6.cpp
+++ b/test/CXX/dcl.decl/dcl.init/p6.cpp
@@ -12,5 +12,5 @@ struct HasUserDefault { HasUserDefault(); };
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'}}
}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp
index ac0ec85db0..f032bf9979 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.array/p1.cpp
@@ -5,7 +5,7 @@ int ar1[10];
// 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
diff --git a/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp b/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp
index b0f1c46a52..44e65f29ca 100644
--- a/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp
+++ b/test/CXX/temp/temp.arg/temp.arg.nontype/p5.cpp
@@ -88,19 +88,19 @@ namespace reference_parameters {
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;
diff --git a/test/CXX/temp/temp.decls/temp.mem/p5.cpp b/test/CXX/temp/temp.decls/temp.mem/p5.cpp
index b0078d4bdb..7adc6f06da 100644
--- a/test/CXX/temp/temp.decls/temp.mem/p5.cpp
+++ b/test/CXX/temp/temp.decls/temp.mem/p5.cpp
@@ -67,8 +67,8 @@ struct X0 {
}
};
-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) {
diff --git a/test/Index/complete-exprs.c b/test/Index/complete-exprs.c
index 2a7a1e2121..fd84d1c0e3 100644
--- a/test/Index/complete-exprs.c
+++ b/test/Index/complete-exprs.c
@@ -48,6 +48,6 @@ void f4(const char* str) {
// 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)
diff --git a/test/Rewriter/finally.m b/test/Rewriter/finally.m
index 67774b5d9c..7d160cfbdd 100644
--- a/test/Rewriter/finally.m
+++ b/test/Rewriter/finally.m
@@ -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 {
diff --git a/test/Sema/address_spaces.c b/test/Sema/address_spaces.c
index 23c1405011..538deda0c2 100644
--- a/test/Sema/address_spaces.c
+++ b/test/Sema/address_spaces.c
@@ -37,6 +37,6 @@ struct _st {
__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}}
}
diff --git a/test/Sema/array-constraint.c b/test/Sema/array-constraint.c
index 9fcac25abe..fe7fdc7115 100644
--- a/test/Sema/array-constraint.c
+++ b/test/Sema/array-constraint.c
@@ -46,7 +46,7 @@ typedef int TA[I]; // expected-error {{variable length array declaration not all
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}}
}
diff --git a/test/Sema/asm.c b/test/Sema/asm.c
index 6f2272da9e..52611faf3d 100644
--- a/test/Sema/asm.c
+++ b/test/Sema/asm.c
@@ -36,7 +36,7 @@ void test3() {
// <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'}}
diff --git a/test/Sema/block-call.c b/test/Sema/block-call.c
index 27e4cfc6d4..fbf0da4eb8 100644
--- a/test/Sema/block-call.c
+++ b/test/Sema/block-call.c
@@ -13,7 +13,7 @@ int main() {
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;
diff --git a/test/Sema/block-return.c b/test/Sema/block-return.c
index 5a4ec010d3..c6fcbe78ee 100644
--- a/test/Sema/block-return.c
+++ b/test/Sema/block-return.c
@@ -78,10 +78,10 @@ static int funk(char *s) {
}
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 foo6() {
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; };
diff --git a/test/Sema/implicit-builtin-decl.c b/test/Sema/implicit-builtin-decl.c
index 3d920389a2..9e01de1c85 100644
--- a/test/Sema/implicit-builtin-decl.c
+++ b/test/Sema/implicit-builtin-decl.c
@@ -18,7 +18,7 @@ void g(int malloc) { // okay: these aren't functions
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() {
diff --git a/test/Sema/knr-def-call.c b/test/Sema/knr-def-call.c
index 66f2ec07f2..fd06cbf645 100644
--- a/test/Sema/knr-def-call.c
+++ b/test/Sema/knr-def-call.c
@@ -23,7 +23,7 @@ void f4() {
}
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;
}
diff --git a/test/Sema/predef.c b/test/Sema/predef.c
index 08a4a2bf83..95bcfb9d8d 100644
--- a/test/Sema/predef.c
+++ b/test/Sema/predef.c
@@ -6,7 +6,7 @@ void abcdefghi12(void) {
}
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}}
diff --git a/test/Sema/vector-assign.c b/test/Sema/vector-assign.c
index 05fc3b13db..8b0dc9288e 100644
--- a/test/Sema/vector-assign.c
+++ b/test/Sema/vector-assign.c
@@ -49,5 +49,5 @@ longlongvec;
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 *'}}
}
diff --git a/test/Sema/warn-write-strings.c b/test/Sema/warn-write-strings.c
index 04af00ca2d..450d0a6fe6 100644
--- a/test/Sema/warn-write-strings.c
+++ b/test/Sema/warn-write-strings.c
@@ -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}}
diff --git a/test/SemaCXX/ambig-user-defined-conversions.cpp b/test/SemaCXX/ambig-user-defined-conversions.cpp
index fdb399b03a..dd8501adb6 100644
--- a/test/SemaCXX/ambig-user-defined-conversions.cpp
+++ b/test/SemaCXX/ambig-user-defined-conversions.cpp
@@ -20,7 +20,7 @@ namespace test0 {
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.
diff --git a/test/SemaCXX/ambiguous-builtin-unary-operator.cpp b/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
index 1aa09a6827..836e319f84 100644
--- a/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
+++ b/test/SemaCXX/ambiguous-builtin-unary-operator.cpp
@@ -28,7 +28,7 @@ struct C1 : B1, A1 { };
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 &)}}
}
diff --git a/test/SemaCXX/builtin-ptrtomember-ambig.cpp b/test/SemaCXX/builtin-ptrtomember-ambig.cpp
index 3e0dfbb48e..1b0460d091 100644
--- a/test/SemaCXX/builtin-ptrtomember-ambig.cpp
+++ b/test/SemaCXX/builtin-ptrtomember-ambig.cpp
@@ -19,9 +19,9 @@ struct C : B {
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::*)}}
}
diff --git a/test/SemaCXX/class.cpp b/test/SemaCXX/class.cpp
index 9d9508b8ef..e51d0fdff9 100644
--- a/test/SemaCXX/class.cpp
+++ b/test/SemaCXX/class.cpp
@@ -89,7 +89,7 @@ struct C3 {
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);
}
diff --git a/test/SemaCXX/composite-pointer-type.cpp b/test/SemaCXX/composite-pointer-type.cpp
index e8b09204d1..06fc8f4385 100644
--- a/test/SemaCXX/composite-pointer-type.cpp
+++ b/test/SemaCXX/composite-pointer-type.cpp
@@ -53,8 +53,8 @@ bool f(Matrix4 m1, const Matrix4 m2) {
// 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 *'}}
}
diff --git a/test/SemaCXX/const-cast.cpp b/test/SemaCXX/const-cast.cpp
index 50bd316278..62851f8128 100644
--- a/test/SemaCXX/const-cast.cpp
+++ b/test/SemaCXX/const-cast.cpp
@@ -45,16 +45,16 @@ char ***good_const_cast_test(ccvpcvpp var)
short *bad_const_cast_test(char const *volatile *const volatile *var)
{
// Different pointer levels.