From abe15e553e58165e7692c0d0842865c488ed7b45 Mon Sep 17 00:00:00 2001 From: Roman Divacky Date: Fri, 1 Jan 2010 10:34:51 +0000 Subject: Updaet clang to 92395. --- test/SemaTemplate/default-expr-arguments.cpp | 47 +++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 7 deletions(-) (limited to 'test/SemaTemplate/default-expr-arguments.cpp') diff --git a/test/SemaTemplate/default-expr-arguments.cpp b/test/SemaTemplate/default-expr-arguments.cpp index 34ac2d967efc2..0edc504ea0a37 100644 --- a/test/SemaTemplate/default-expr-arguments.cpp +++ b/test/SemaTemplate/default-expr-arguments.cpp @@ -1,14 +1,13 @@ -// RUN: clang-cc -fsyntax-only -verify %s - +// RUN: %clang_cc1 -fsyntax-only -verify %s template class C { C(int a0 = 0); }; template<> C::C(int a0); -struct S { }; +struct S { }; // expected-note 3 {{candidate function}} -template void f1(T a, T b = 10) { } // expected-error{{cannot initialize 'b' with an rvalue of type 'int'}} +template void f1(T a, T b = 10) { } // expected-error{{no viable conversion}} template void f2(T a, T b = T()) { } @@ -26,8 +25,8 @@ void g() { } template struct F { - F(T t = 10); // expected-error{{cannot initialize 't' with an rvalue of type 'int'}} - void f(T t = 10); // expected-error{{cannot initialize 't' with an rvalue of type 'int'}} + F(T t = 10); // expected-error{{no viable conversion}} + void f(T t = 10); // expected-error{{no viable conversion}} }; struct FD : F { }; @@ -100,7 +99,7 @@ void test_x2(X2 x2i, X2 x2n) { // PR5283 namespace PR5283 { template struct A { - A(T = 1); // expected-error 3 {{incompatible type initializing 'int', expected 'int *'}} + A(T = 1); // expected-error 3 {{cannot initialize a parameter of type 'int *' with an rvalue of type 'int'}} }; struct B : A { @@ -144,3 +143,37 @@ namespace pr5301 { } } +// PR5810 +namespace PR5810 { + template + struct allocator { + allocator() { int a[sizeof(T) ? -1 : -1]; } // expected-error2 {{array size is negative}} + }; + + template + struct vector { + vector(const allocator& = allocator()) {} // expected-note2 {{instantiation of}} + }; + + struct A { }; + struct B { }; + + template + void FilterVTs() { + vector Result; + } + + void f() { + vector Result; + } + + template + struct X { + vector bs; + X() { } + }; + + void f2() { + X x; // expected-note{{member function}} + } +} -- cgit v1.2.3