diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp | 2 | ||||
-rw-r--r-- | clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp | 6 | ||||
-rw-r--r-- | clang/test/Index/complete-exprs.cpp | 4 | ||||
-rw-r--r-- | clang/test/SemaCXX/type-formatting.cpp | 10 | ||||
-rw-r--r-- | clang/test/SemaTemplate/deduction.cpp | 2 | ||||
-rw-r--r-- | clang/test/SemaTemplate/instantiate-static-var.cpp | 2 |
6 files changed, 18 insertions, 8 deletions
diff --git a/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp b/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp index 7adc6f06da3..a188f05d535 100644 --- a/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.mem/p5.cpp @@ -63,7 +63,7 @@ struct X0 { template<typename T> operator const T*() const { T x = T(); - return x; // expected-error{{cannot initialize return object of type 'char const *' with an lvalue of type 'char'}} + return x; // expected-error{{cannot initialize return object of type 'const char *' with an lvalue of type 'char'}} } }; diff --git a/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp b/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp index 05d9b328a36..f18a74a1e4e 100644 --- a/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp +++ b/clang/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3-0x.cpp @@ -23,8 +23,8 @@ void test_f0() { X<Y&> xy2 = f0(lvalue<Y>()); } -template<typename T> X<T> f1(const T&&); // expected-note{{candidate function [with T = int] not viable: no known conversion from 'int' to 'int const &&' for 1st argument}} \ -// expected-note{{candidate function [with T = Y] not viable: no known conversion from 'Y' to 'Y const &&' for 1st argument}} +template<typename T> X<T> f1(const T&&); // expected-note{{candidate function [with T = int] not viable: no known conversion from 'int' to 'const int &&' for 1st argument}} \ +// expected-note{{candidate function [with T = Y] not viable: no known conversion from 'Y' to 'const Y &&' for 1st argument}} void test_f1() { X<int> xi0 = f1(prvalue<int>()); @@ -37,7 +37,7 @@ void test_f1() { namespace std_example { template <class T> int f(T&&); - template <class T> int g(const T&&); // expected-note{{candidate function [with T = int] not viable: no known conversion from 'int' to 'int const &&' for 1st argument}} + template <class T> int g(const T&&); // expected-note{{candidate function [with T = int] not viable: no known conversion from 'int' to 'const int &&' for 1st argument}} int i; int n1 = f(i); diff --git a/clang/test/Index/complete-exprs.cpp b/clang/test/Index/complete-exprs.cpp index 016254e763d..a8100653b2a 100644 --- a/clang/test/Index/complete-exprs.cpp +++ b/clang/test/Index/complete-exprs.cpp @@ -35,7 +35,7 @@ void g() { // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{Placeholder const char *}{RightParen )} (50) // CHECK-CC1: CXXConstructor:{TypedText string}{LeftParen (}{Placeholder const char *}{Comma , }{Placeholder int n}{RightParen )} (50) // CHECK-CC1: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50) -// CHECK-CC1: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder T const &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50) +// CHECK-CC1: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder const T &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50) // CHECK-CC1: FunctionTemplate:{ResultType void}{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder InputIterator first}{Comma , }{Placeholder InputIterator last}{RightParen )} (50) // RUN: c-index-test -code-completion-at=%s:19:1 %s | FileCheck -check-prefix=CHECK-CC2 %s @@ -49,5 +49,5 @@ void g() { // CHECK-CC3: FunctionDecl:{ResultType int}{TypedText foo}{LeftParen (}{RightParen )} (50) // CHECK-CC3: FunctionDecl:{ResultType void}{TypedText g}{LeftParen (}{RightParen )} (50) // CHECK-CC3: ClassTemplate:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >} (50) -// CHECK-CC3: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder T const &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50) +// CHECK-CC3: CXXConstructor:{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder const T &}{Comma , }{Placeholder unsigned int n}{RightParen )} (50) // CHECK-CC3: FunctionTemplate:{ResultType void}{TypedText vector}{LeftAngle <}{Placeholder typename T}{RightAngle >}{LeftParen (}{Placeholder InputIterator first}{Comma , }{Placeholder InputIterator last}{RightParen )} (50) diff --git a/clang/test/SemaCXX/type-formatting.cpp b/clang/test/SemaCXX/type-formatting.cpp new file mode 100644 index 00000000000..3fe9278c40b --- /dev/null +++ b/clang/test/SemaCXX/type-formatting.cpp @@ -0,0 +1,10 @@ +// RUN: %clang_cc1 -fsyntax-only -verify %s + +struct X0 { }; +struct X1 { }; + +template<typename T> +void f0() { + const T *t = (const X0*)0; // expected-error{{cannot initialize a variable of type 'const X1 *' with an rvalue of type 'const X0 *'}} +} +template void f0<X1>(); // expected-note{{instantiation of}} diff --git a/clang/test/SemaTemplate/deduction.cpp b/clang/test/SemaTemplate/deduction.cpp index cf98d6e0ac4..15c061c2619 100644 --- a/clang/test/SemaTemplate/deduction.cpp +++ b/clang/test/SemaTemplate/deduction.cpp @@ -107,7 +107,7 @@ namespace PR7463 { } namespace test0 { - template <class T> void make(const T *(*fn)()); // expected-note {{candidate template ignored: can't deduce a type for 'T' which would make 'T const' equal 'char'}} + template <class T> void make(const T *(*fn)()); // expected-note {{candidate template ignored: can't deduce a type for 'T' which would make 'const T' equal 'char'}} char *char_maker(); void test() { make(char_maker); // expected-error {{no matching function for call to 'make'}} diff --git a/clang/test/SemaTemplate/instantiate-static-var.cpp b/clang/test/SemaTemplate/instantiate-static-var.cpp index cd25ccb3d31..0c060752483 100644 --- a/clang/test/SemaTemplate/instantiate-static-var.cpp +++ b/clang/test/SemaTemplate/instantiate-static-var.cpp @@ -11,7 +11,7 @@ X<int, 0> xi0; // expected-note{{in instantiation of template class 'X<int, 0>' template<typename T> class Y { - static const T value = 0; // expected-warning{{in-class initializer for static data member of type 'float const' is a C++0x extension}} + static const T value = 0; // expected-warning{{in-class initializer for static data member of type 'const float' is a C++0x extension}} }; Y<float> fy; // expected-note{{in instantiation of template class 'Y<float>' requested here}} |