]> granicus.if.org Git - clang/commitdiff
'const std::type_info*' instead of 'std::type_info const*'
authorChris Lattner <sabre@nondot.org>
Sun, 5 Sep 2010 00:17:29 +0000 (00:17 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 5 Sep 2010 00:17:29 +0000 (00:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113092 91177308-0d34-0410-b5e6-96231b3b80d8

21 files changed:
lib/AST/TypePrinter.cpp
test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-examples.cpp
test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
test/CXX/dcl.decl/dcl.init/p6.cpp
test/CXX/special/class.copy/p9.cpp
test/CodeGenCXX/vtable-layout.cpp
test/Index/code-completion.cpp
test/Misc/diag-aka-types.cpp
test/SemaCXX/builtin-ptrtomember-ambig.cpp
test/SemaCXX/conditional-expr.cpp
test/SemaCXX/copy-initialization.cpp
test/SemaCXX/decl-init-ref.cpp
test/SemaCXX/direct-initializer.cpp
test/SemaCXX/overload-member-call.cpp
test/SemaCXX/overloaded-operator.cpp
test/SemaCXX/ref-init-ambiguous.cpp
test/SemaCXX/static-cast.cpp
test/SemaCXX/virtual-override.cpp
test/SemaObjC/bad-receiver-1.m
test/SemaTemplate/fun-template-def.cpp
test/SemaTemplate/temp_arg_nontype.cpp

index f5291871455ab7cc4c296fd1ab22228590d0b03a..e0805715520cd84b95743522abe10c12930ae0f4 100644 (file)
@@ -73,7 +73,7 @@ void TypePrinter::Print(QualType T, std::string &S) {
   // "int * const", printing "const int *" is different.  Only do this when the
   // type expands to a simple string.
   bool CanPrefixQualifiers =
-    isa<BuiltinType>(T) || isa<TypedefType>(T);
+    isa<BuiltinType>(T) || isa<TypedefType>(T) || isa<TagType>(T);
   
   if (!CanPrefixQualifiers && !Quals.empty()) {
     std::string TQS;
index b50bcb9aec8e1e4dda73280048da612eb33037b7..5ab1ecd29560aa95185988688620353f17478e53 100644 (file)
@@ -19,8 +19,8 @@ void example1() {
   // CHECK: A &ra =
   // CHECK: ImplicitCastExpr{{.*}}'struct A' <DerivedToBase (A)> lvalue
   A &ra = b;
-  // CHECK: A const &rca =
-  // CHECK: ImplicitCastExpr{{.*}}'struct A const' <NoOp>
+  // CHECK: const A &rca =
+  // CHECK: ImplicitCastExpr{{.*}}'const struct A' <NoOp>
   // CHECK: ImplicitCastExpr{{.*}}'struct A' <DerivedToBase (A)>
   const A& rca = b;
 }
@@ -33,13 +33,13 @@ struct X {
 
 // CHECK: example2
 void example2() {
-  // CHECK: A const &rca =
-  // CHECK: ImplicitCastExpr{{.*}}'struct A const' <NoOp>
+  // CHECK: const A &rca =
+  // CHECK: ImplicitCastExpr{{.*}}'const struct A' <NoOp>
   // CHECK: ImplicitCastExpr{{.*}}'struct A' <DerivedToBase (A)>
   // CHECK: CallExpr{{.*}}B
   const A &rca = f(); 
-  // CHECK: A const &r =
-  // CHECK: ImplicitCastExpr{{.*}}'struct A const' <NoOp>
+  // CHECK: const A &r =
+  // CHECK: ImplicitCastExpr{{.*}}'const struct A' <NoOp>
   // CHECK: ImplicitCastExpr{{.*}}'struct A' <DerivedToBase (A)>
   // CHECK: CXXMemberCallExpr{{.*}}'struct B'
   const A& r = x;
index 382488a9b6e467ee79dc6f4be2a1713d2d188140..099f91caf63d093ead18d3466a74d4d86eefc2af 100644 (file)
@@ -64,8 +64,8 @@ void bind_lvalue_quals(volatile Base b, volatile Derived d,
                        volatile const int ivc) {
   volatile Base &bvr1 = b;
   volatile Base &bvr2 = 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 Base &bvr3 = bvc; // expected-error{{binding of reference to type 'volatile Base' to a value of type 'const volatile Base' drops qualifiers}}
+  volatile Base &bvr4 = dvc; // expected-error{{binding of reference to type 'volatile Base' to a value of type 'const volatile Derived' 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}}
 
@@ -76,15 +76,15 @@ void bind_lvalue_quals(volatile Base b, volatile Derived d,
 void bind_lvalue_to_rvalue() {
   Base &br1 = Base(); // expected-error{{non-const lvalue reference to type 'Base' cannot bind to a temporary of type 'Base'}}
   Base &br2 = Derived(); // expected-error{{non-const lvalue reference to type 'Base' cannot bind to a temporary of type 'Derived'}}
-  const volatile Base &br3 = Base(); // expected-error{{volatile lvalue reference to type 'Base const volatile' cannot bind to a temporary of type 'Base'}}
-  const volatile Base &br4 = Derived(); // expected-error{{volatile lvalue reference to type 'Base const volatile' cannot bind to a temporary of type 'Derived'}}
+  const volatile Base &br3 = Base(); // expected-error{{volatile lvalue reference to type 'const volatile Base' cannot bind to a temporary of type 'Base'}}
+  const volatile Base &br4 = Derived(); // expected-error{{volatile lvalue reference to type 'const volatile Base' cannot bind to a temporary of type 'Derived'}}
 
   int &ir = 17; // expected-error{{non-const lvalue reference to type 'int' cannot bind to a temporary of type 'int'}}
 }
 
 void bind_lvalue_to_unrelated(Unrelated ur) {
   Base &br1 = ur; // expected-error{{non-const lvalue reference to type 'Base' cannot bind to a value of unrelated type 'Unrelated'}}
-  const volatile Base &br2 = ur; // expected-error{{volatile lvalue reference to type 'Base const volatile' cannot bind to a value of unrelated type 'Unrelated'}}
+  const volatile Base &br2 = ur; // expected-error{{volatile lvalue reference to type 'const volatile Base' cannot bind to a value of unrelated type 'Unrelated'}}
 }
 
 void bind_lvalue_to_conv_lvalue() {
@@ -118,8 +118,8 @@ void bind_const_lvalue_to_rvalue() {
   const Base &br3 = create<const Base>();
   const Base &br4 = create<const Derived>();
 
-  const Base &br5 = create<const volatile Base>(); // expected-error{{binding of reference to type 'Base const' to a value of type 'Base const volatile' drops qualifiers}}
-  const Base &br6 = create<const volatile Derived>(); // expected-error{{binding of reference to type 'Base const' to a value of type 'Derived const volatile' drops qualifiers}}
+  const Base &br5 = create<const volatile Base>(); // expected-error{{binding of reference to type 'const Base' to a value of type 'const volatile Base' drops qualifiers}}
+  const Base &br6 = create<const volatile Derived>(); // expected-error{{binding of reference to type 'const Base' to a value of type 'const volatile Derived' drops qualifiers}}
 
   const int &ir = create<int>();
 }
@@ -131,5 +131,5 @@ void bind_const_lvalue_to_class_conv_temporary() {
 }
 void bind_lvalue_to_conv_rvalue_ambig(ConvertibleToBothDerived both) {
   const Derived &dr1 = both;
-  const Base &br1 = both; // expected-error{{reference initialization of type 'Base const &' with initializer of type 'ConvertibleToBothDerived' is ambiguous}}
+  const Base &br1 = both; // expected-error{{reference initialization of type 'const Base &' with initializer of type 'ConvertibleToBothDerived' is ambiguous}}
 }
index 7767761b1dcb8c99cae9b357fed9ef799205c70e..da6f5b5369d03072abae8f2d09263fb141ef4665 100644 (file)
@@ -10,7 +10,7 @@ struct NoUserDefault : public MakeNonPOD { };
 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 NoUserDefault x1; // expected-error{{default initialization of an object of const type 'const NoUserDefault' requires a user-provided default constructor}}
   const HasUserDefault x2;
   const int x3; // expected-error{{default initialization of an object of const type 'const int'}}
 }
index d03794420e01b10f80c09cda33da54064a2deab9..494b12fd7901240d29a641821dbedbf21a8c73ce 100644 (file)
@@ -37,8 +37,8 @@ void test_non_const_copy(const ImplicitNonConstCopy1 &cincc1,
                          const ImplicitNonConstCopy2 &cincc2,
                          const ImplicitNonConstCopy3 &cincc3,
                          const ImplicitNonConstCopy4 &cincc4) {
-  (void)sizeof(ImplicitNonConstCopy1(cincc1)); // expected-error{{functional-style cast from 'ImplicitNonConstCopy1 const' to 'ImplicitNonConstCopy1' is not allowed}}
-  (void)sizeof(ImplicitNonConstCopy2(cincc2)); // expected-error{{functional-style cast from 'ImplicitNonConstCopy2 const' to 'ImplicitNonConstCopy2' is not allowed}}
-  (void)sizeof(ImplicitNonConstCopy3(cincc3)); // expected-error{{functional-style cast from 'ImplicitNonConstCopy3 const' to 'ImplicitNonConstCopy3' is not allowed}}
-  (void)sizeof(ImplicitNonConstCopy4(cincc4)); // expected-error{{functional-style cast from 'ImplicitNonConstCopy4 const' to 'ImplicitNonConstCopy4' is not allowed}}
+  (void)sizeof(ImplicitNonConstCopy1(cincc1)); // expected-error{{functional-style cast from 'const ImplicitNonConstCopy1' to 'ImplicitNonConstCopy1' is not allowed}}
+  (void)sizeof(ImplicitNonConstCopy2(cincc2)); // expected-error{{functional-style cast from 'const ImplicitNonConstCopy2' to 'ImplicitNonConstCopy2' is not allowed}}
+  (void)sizeof(ImplicitNonConstCopy3(cincc3)); // expected-error{{functional-style cast from 'const ImplicitNonConstCopy3' to 'ImplicitNonConstCopy3' is not allowed}}
+  (void)sizeof(ImplicitNonConstCopy4(cincc4)); // expected-error{{functional-style cast from 'const ImplicitNonConstCopy4' to 'ImplicitNonConstCopy4' is not allowed}}
 }
index 60b46fec39b38d58eaf6b35a2a53729b5a7ffaba..1cf8a52d44b9edcd734d1136255524d9a9c7873a 100644 (file)
@@ -78,7 +78,7 @@ namespace Test2 {
 // CHECK-2-NEXT:   5 | Test2::A::~A() [complete]
 // CHECK-2-NEXT:   6 | Test2::A::~A() [deleting]
 // CHECK-2-NEXT:   7 | void Test2::A::h()
-// CHECK-2-NEXT:   8 | Test2::A &Test2::A::operator=(Test2::A const &)
+// CHECK-2-NEXT:   8 | Test2::A &Test2::A::operator=(const Test2::A &)
 struct A {
   virtual void f();
   virtual void f() const;
index 7b0c8d75d81e2f3d7b5d197b0ac098da718551b8..a0f0d3e70c3c915d05b874aa9d0ab1e888522da7 100644 (file)
@@ -42,9 +42,9 @@ Z::operator int() const {
 // CHECK-MEMBER: FieldDecl:{ResultType float}{Text Y::}{TypedText member}
 // CHECK-MEMBER: CXXMethod:{ResultType void}{Informative Y::}{TypedText memfunc}{LeftParen (}{Optional {Placeholder int i}}{RightParen )}
 // CHECK-MEMBER: CXXConversion:{ResultType int}{TypedText operator int}{LeftParen (}{RightParen )}{Informative  const}
-// CHECK-MEMBER: CXXMethod:{ResultType Z &}{TypedText operator=}{LeftParen (}{Placeholder Z const &}{RightParen )}
-// CHECK-MEMBER: CXXMethod:{ResultType X &}{Text X::}{TypedText operator=}{LeftParen (}{Placeholder X const &}{RightParen )}
-// CHECK-MEMBER: CXXMethod:{ResultType Y &}{Text Y::}{TypedText operator=}{LeftParen (}{Placeholder Y const &}{RightParen )}
+// CHECK-MEMBER: CXXMethod:{ResultType Z &}{TypedText operator=}{LeftParen (}{Placeholder const Z &}{RightParen )}
+// CHECK-MEMBER: CXXMethod:{ResultType X &}{Text X::}{TypedText operator=}{LeftParen (}{Placeholder const X &}{RightParen )}
+// CHECK-MEMBER: CXXMethod:{ResultType Y &}{Text Y::}{TypedText operator=}{LeftParen (}{Placeholder const Y &}{RightParen )}
 // CHECK-MEMBER: EnumConstantDecl:{ResultType X::E}{Informative E::}{TypedText Val1}
 // CHECK-MEMBER: StructDecl:{TypedText X}{Text ::}
 // CHECK-MEMBER: StructDecl:{TypedText Y}{Text ::}
index 51d4093e7489f2bcf631da211d899001787d92e6..b1c94ff539e4b4367a16645c8f04291f41bc098f 100644 (file)
@@ -7,4 +7,4 @@ foo_t *ptr;
 char c1 = ptr; // expected-error{{'foo_t *' (aka 'X *')}}
 
 const foo_t &ref = foo_t();
-char c2 = ref; // expected-error{{'const foo_t' (aka 'X const')}}
+char c2 = ref; // expected-error{{'const foo_t' (aka 'const X')}}
index 1b0460d09159e098355f5f34ba35a9cb878a08e6..32a893dafcef42688b92c788e4b31abf336279e2 100644 (file)
@@ -19,8 +19,8 @@ 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 *, const int struct A::*)}} \
-                               // expected-note {{built-in candidate operator->*(struct A const *, int struct A::*)}} \
+                               // expected-note {{built-in candidate operator->*(const struct A *, const int struct A::*)}} \
+                               // expected-note {{built-in candidate operator->*(const struct A *, int 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::*)}}
 }
index 065179b6da59d3b9c970c6a7f854ff8dd11a16ad..a7f2a4c9151e0b1192d8934ff3a04ba5a0402ff2 100644 (file)
@@ -106,8 +106,8 @@ void test()
   i1 = (i1 ? Base() : Derived()).trick();
   i1 = (i1 ? Derived() : Base()).trick();
   // should fail: const lost
-  (void)(i1 ? Base() : constder()); // expected-error {{incompatible operand types ('Base' and 'Derived const')}}
-  (void)(i1 ? constder() : Base()); // expected-error {{incompatible operand types ('Derived const' and 'Base')}}
+  (void)(i1 ? Base() : constder()); // expected-error {{incompatible operand types ('Base' and 'const Derived')}}
+  (void)(i1 ? constder() : Base()); // expected-error {{incompatible operand types ('const Derived' and 'Base')}}
 
   Priv priv;
   Fin fin;
index 0c4aa964cb668f5db22a7c22ec69ae3a544b381d..641eaa9411f1a31a0518047e4d763add79231c87 100644 (file)
@@ -23,7 +23,7 @@ struct foo {
 };
 
 // PR3600
-void test(const foo *P) { P->bar(); } // expected-error{{cannot initialize object parameter of type 'foo' with an expression of type 'foo const'}}
+void test(const foo *P) { P->bar(); } // expected-error{{cannot initialize object parameter of type 'foo' with an expression of type 'const foo'}}
 
 namespace PR6757 {
   struct Foo {
@@ -38,7 +38,7 @@ namespace PR6757 {
   void f(Foo);
 
   void g(Foo foo) {
-    f(Bar()); // expected-error{{no viable constructor copying parameter of type 'PR6757::Foo const'}}
+    f(Bar()); // expected-error{{no viable constructor copying parameter of type 'const PR6757::Foo'}}
     f(foo);
   }
 }
index 922f0b780486d163fb2be0b1be79e064d926b58a..dc56332b5d00956bbcc8df61fb1b9c12658b5441 100644 (file)
@@ -21,7 +21,7 @@ extern B f();
 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}}
+        const A& rca = f(); // expected-error {{reference initialization of type 'const A &' with initializer of type 'B' is ambiguous}}
         A& ra = f(); // expected-error {{non-const lvalue reference to type 'A' cannot bind to a temporary of type 'B'}}
 }
 
index 54cd6cacc0d4fea2c059a78272f80542c0cb02f8..a7899c75e4dc07571a34e3bee5e9b22213ebc2dc 100644 (file)
@@ -44,7 +44,7 @@ struct Derived : Base {
 };
 
 void foo(const Derived cd, Derived d) {
-        int *pi = cd;  // expected-error {{no viable conversion from 'Derived const' to 'int *'}}
+        int *pi = cd;  // expected-error {{no viable conversion from 'const Derived' to 'int *'}}
         int *ppi = d; 
 
 }
index 885a950a771b7373cb5a588891624860d63e343f..37815b9ccce8be741f4643b57e8e8ec0b10308f4 100644 (file)
@@ -78,11 +78,11 @@ namespace test1 {
     void foo(int n, const char *s, int t, ...); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
     void foo(int n, const char *s, int t, int u = 0); // expected-note {{candidate function not viable: requires at least 3 arguments, but 2 were provided}}
 
-    void bar(double d); //expected-note {{candidate function not viable: 'this' argument has type 'test1::A const', but method is not marked const}}
-    void bar(int i); //expected-note {{candidate function not viable: 'this' argument has type 'test1::A const', but method is not marked const}}
+    void bar(double d); //expected-note {{candidate function not viable: 'this' argument has type 'const test1::A', but method is not marked const}}
+    void bar(int i); //expected-note {{candidate function not viable: 'this' argument has type 'const test1::A', but method is not marked const}}
 
-    void baz(A &d); // expected-note {{candidate function not viable: 1st argument ('test1::A const') would lose const qualifier}}
-    void baz(int i); // expected-note {{candidate function not viable: no known conversion from 'test1::A const' to 'int' for 1st argument}} 
+    void baz(A &d); // expected-note {{candidate function not viable: 1st argument ('const test1::A') would lose const qualifier}}
+    void baz(int i); // expected-note {{candidate function not viable: no known conversion from 'const test1::A' to 'int' for 1st argument}} 
   };
 
   void test() {
index 24f7f66129ebd9b4564297e632701a8bf56b48ae..a33ea5dede19e81945d22840baeabe6f95cdc324 100644 (file)
@@ -38,7 +38,7 @@ bool operator==(A&, Z&); // expected-note 2{{candidate function}}
 void h(A a, const A ac, Z z) {
   make_A() == z;
   a == z; // expected-error{{use of overloaded operator '==' is ambiguous; candidates are:}}
-  ac == z; // expected-error{{invalid operands to binary expression ('A const' and 'Z')}}
+  ac == z; // expected-error{{invalid operands to binary expression ('const A' and 'Z')}}
 }
 
 struct B {
index a8e95a39539d50b05b34d3efa43f090d49911d85..752a3484d0258f424edac62ba16788a94ad18448 100644 (file)
@@ -14,15 +14,15 @@ struct C : B, A {
 };
 
 void test(C c) {
-  const E2 &e2 = c; // expected-error {{reference initialization of type 'E2 const &' with initializer of type 'C' is ambiguous}}
+  const E2 &e2 = c; // expected-error {{reference initialization of type 'const E2 &' with initializer of type 'C' is ambiguous}}
 }
 
 void foo(const E2 &);// expected-note{{passing argument to parameter here}}
 
 const E2 & re(C c) {
-    foo(c); // expected-error {{reference initialization of type 'E2 const &' with initializer of type 'C' is ambiguous}}
+    foo(c); // expected-error {{reference initialization of type 'const E2 &' with initializer of type 'C' is ambiguous}}
 
-    return c; // expected-error {{reference initialization of type 'E2 const &' with initializer of type 'C' is ambiguous}}
+    return c; // expected-error {{reference initialization of type 'const E2 &' with initializer of type 'C' is ambiguous}}
 }
 
 
index 9af200d574e80f8836191bc8efa606af23d6de0d..c8639a9544057d56b83ab7c4e0004f04b72b2dba 100644 (file)
@@ -84,8 +84,8 @@ void t_529_5_8()
   (void)static_cast<C1&>(*((A*)0)); // expected-error {{cannot cast 'A' to 'C1 &' via virtual base 'B'}}
   (void)static_cast<D*>((A*)0); // expected-error {{cannot cast 'A *' to 'D *' via virtual base 'B'}}
   (void)static_cast<D&>(*((A*)0)); // expected-error {{cannot cast 'A' to 'D &' via virtual base 'B'}}
-  (void)static_cast<B*>((const A*)0); // expected-error {{static_cast from 'A const *' to 'B *' casts away constness}}
-  (void)static_cast<B&>(*((const A*)0)); // expected-error {{static_cast from 'A const' to 'B &' casts away constness}}
+  (void)static_cast<B*>((const A*)0); // expected-error {{static_cast from 'const A *' to 'B *' casts away constness}}
+  (void)static_cast<B&>(*((const A*)0)); // expected-error {{static_cast from 'const A' to 'B &' casts away constness}}
   (void)static_cast<E*>((A*)0); // expected-error {{cannot cast private base class 'A' to 'E'}}
   (void)static_cast<E&>(*((A*)0)); // expected-error {{cannot cast private base class 'A' to 'E'}}
   (void)static_cast<H*>((A*)0); // expected-error {{ambiguous cast from base 'A' to derived 'H':\n    struct A -> struct B -> struct G1 -> struct H\n    struct A -> struct B -> struct G2 -> struct H}}
index e07531f64365cb554f58558ec41cb5854be7d052..b1d2a3a05c7cadf36482f77ed7b9dfb05727c0aa 100644 (file)
@@ -86,7 +86,7 @@ class A {
 
 class B : A {
   virtual a* f(); 
-  virtual const a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides (class type 'T6::a const *' is more qualified than class type 'T6::a *'}}
+  virtual const a* g(); // expected-error{{return type of virtual function 'g' is not covariant with the return type of the function it overrides (class type 'const T6::a *' is more qualified than class type 'T6::a *'}}
 };
 
 }
index 33e1630864751be80dbe99cbbe72fe16d934807f..fe3eecff2bcf348409d3b051d224b194364d8fc3 100644 (file)
@@ -16,6 +16,6 @@ typedef const struct __CFString * CFStringRef;
 void func() {
   CFStringRef obj;
 
-  [obj self]; // expected-warning {{receiver type 'CFStringRef' (aka 'struct __CFString const *') is not 'id'}} \\
+  [obj self]; // expected-warning {{receiver type 'CFStringRef' (aka 'const struct __CFString *') is not 'id'}} \\
                  expected-warning {{method '-self' not found}}
 }
index 309921c0a6644c893ed0e42a1fc99c654dc83560..04277812187f8c810029ca1484aeffe54cdff687 100644 (file)
@@ -42,7 +42,7 @@ T f1(T t1, U u1, int i1)
   dummy d1 = sizeof(t1); // expected-error {{no viable conversion}}
   dummy d2 = offsetof(T, foo); // expected-error {{no viable conversion}}
   dummy d3 = __alignof(u1); // expected-error {{no viable conversion}}
-  i1 = typeid(t1); // expected-error {{assigning to 'int' from incompatible type 'std::type_info const'}}
+  i1 = typeid(t1); // expected-error {{assigning to 'int' from incompatible type 'const std::type_info'}}
 
   return u1;
 }
index 6f515916e45fc59ee8987629415dee39c34efdcf..dc72db324b621171ffcec73e9c72a7e9a27ab06e 100644 (file)
@@ -58,7 +58,7 @@ template<X const &AnX> struct A4; // expected-note 2{{template parameter is decl
 X an_X;
 A4<an_X> *a15_1; // okay
 A4<*X_volatile_ptr> *a15_2; // expected-error{{non-type template argument does not refer to any declaration}}
-A4<y> *15_3; //  expected-error{{non-type template parameter of reference type 'X const &' cannot bind to template argument of type 'struct Y'}} \
+A4<y> *15_3; //  expected-error{{non-type template parameter of reference type 'const X &' cannot bind to template argument of type 'struct Y'}} \
             // FIXME: expected-error{{expected unqualified-id}}
 
 template<int (&fr)(int)> struct A5; // expected-note{{template parameter is declared here}}