forked from OSchip/llvm-project
[Lit Test] Updated 34 Lit tests to be C++11 compatible.
Added expected diagnostics new to C++11. Expanded RUN line to: default, C++98/03 and C++11. llvm-svn: 253371
This commit is contained in:
parent
de642cef2c
commit
e7cbb3ed4f
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
namespace A {
|
||||
class A {
|
||||
|
@ -20,6 +22,9 @@ namespace D {
|
|||
|
||||
namespace C {
|
||||
class C {}; // expected-note {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'B::B' to 'const C::C &' for 1st argument}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'B::B' to 'C::C &&' for 1st argument}}
|
||||
#endif
|
||||
void func(C); // expected-note {{'C::func' declared here}} \
|
||||
// expected-note {{passing argument to parameter here}}
|
||||
C operator+(C,C);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
namespace Ints {
|
||||
int zero = 0; // expected-note {{candidate found by name lookup is 'Ints::zero'}}
|
||||
|
@ -31,7 +33,11 @@ void test() {
|
|||
}
|
||||
|
||||
namespace Numbers {
|
||||
struct Number { // expected-note 2 {{candidate}}
|
||||
struct Number { // expected-note 2 {{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
explicit Number(double d) : d(d) {}
|
||||
double d;
|
||||
};
|
||||
|
@ -66,7 +72,11 @@ void test3() {
|
|||
|
||||
namespace inline_ns {
|
||||
int x; // expected-note 2{{found}}
|
||||
inline namespace A { // expected-warning {{C++11}}
|
||||
inline namespace A {
|
||||
#if __cplusplus <= 199711L // C++03 or earlier
|
||||
// expected-warning@-2 {{inline namespaces are a C++11 feature}}
|
||||
#endif
|
||||
|
||||
int x; // expected-note 2{{found}}
|
||||
int y; // expected-note 2{{found}}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
// rdar4641403
|
||||
namespace N {
|
||||
|
@ -34,7 +36,10 @@ namespace PR17731 {
|
|||
struct S c = b;
|
||||
}
|
||||
{
|
||||
struct S { S() {} }; // expected-note {{candidate}}
|
||||
struct S { S() {} }; // expected-note {{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
int a = S(); // expected-error {{no viable conversion from 'S'}}
|
||||
struct S c = b; // expected-error {{no viable conversion from 'struct S'}}
|
||||
}
|
||||
|
@ -50,7 +55,10 @@ namespace PR17731 {
|
|||
struct S c = b;
|
||||
}
|
||||
{
|
||||
struct S { S() {} }; // expected-note {{candidate}}
|
||||
struct S { S() {} }; // expected-note {{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
int a = S(); // expected-error {{no viable conversion from 'S'}}
|
||||
struct S c = b; // expected-error {{no viable conversion from 'struct S'}}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,15 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
// We have to avoid ADL for this test.
|
||||
|
||||
template <unsigned N> class test {};
|
||||
|
||||
class foo {}; // expected-note {{candidate}}
|
||||
class foo {}; // expected-note {{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
test<0> foo(foo); // expected-note {{candidate}}
|
||||
|
||||
namespace Test0 {
|
||||
|
|
|
@ -1,26 +1,58 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-c++0x-compat %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
// The auto or register specifiers can be applied only to names of objects
|
||||
// declared in a block (6.3) or to function parameters (8.4).
|
||||
|
||||
auto int ao; // expected-error {{illegal storage class on file-scoped variable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
|
||||
#endif
|
||||
|
||||
auto void af(); // expected-error {{illegal storage class on function}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
|
||||
#endif
|
||||
|
||||
register int ro; // expected-error {{illegal storage class on file-scoped variable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-warning@-2 {{'register' storage class specifier is deprecated}}
|
||||
#endif
|
||||
|
||||
register void rf(); // expected-error {{illegal storage class on function}}
|
||||
|
||||
struct S {
|
||||
auto int ao; // expected-error {{storage class specified for a member declaration}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
|
||||
#endif
|
||||
auto void af(); // expected-error {{storage class specified for a member declaration}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
|
||||
#endif
|
||||
|
||||
register int ro; // expected-error {{storage class specified for a member declaration}}
|
||||
register void rf(); // expected-error {{storage class specified for a member declaration}}
|
||||
};
|
||||
|
||||
void foo(auto int ap, register int rp) {
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
|
||||
#endif
|
||||
auto int abo;
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
|
||||
#endif
|
||||
auto void abf(); // expected-error {{illegal storage class on function}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-warning@-2 {{'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases}}
|
||||
#endif
|
||||
|
||||
register int rbo;
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-warning@-2 {{'register' storage class specifier is deprecated}}
|
||||
#endif
|
||||
|
||||
register void rbf(); // expected-error {{illegal storage class on function}}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
struct Base { };
|
||||
struct Derived : Base { }; // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
struct Unrelated { };
|
||||
struct Derived2 : Base { };
|
||||
struct Diamond : Derived, Derived2 { };
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
// Test instantiation of static data members declared out-of-line.
|
||||
|
||||
|
@ -15,6 +17,9 @@ struct InitOkay {
|
|||
};
|
||||
|
||||
struct CannotInit { }; // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
int &returnInt() { return X<int>::value; }
|
||||
float &returnFloat() { return X<float>::value; }
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
template<typename T>
|
||||
struct X0 {
|
||||
|
@ -13,6 +15,9 @@ struct X1 {
|
|||
};
|
||||
|
||||
struct X2 { }; // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
int& get_int() { return X0<int>::value; }
|
||||
X1& get_X1() { return X0<X1>::value; }
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
// A type-parameter defines its identifier to be a type-name (if
|
||||
// declared with class or typename) or template-name (if declared with
|
||||
|
@ -16,6 +18,10 @@ template<template<class T> class Y> struct X1 {
|
|||
// type-parameter (because its identifier is the name of an already
|
||||
// existing class) is taken as a type-parameter. For example,
|
||||
class T { /* ... */ }; // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
int i;
|
||||
|
||||
template<class T, T i> struct X2 {
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
struct C { };
|
||||
|
||||
|
@ -49,6 +51,9 @@ template void X1<int>::f<>(int&, int*); // expected-note{{instantiation}}
|
|||
// Explicitly instantiate members of a class template
|
||||
struct Incomplete; // expected-note{{forward declaration}}
|
||||
struct NonDefaultConstructible { // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
NonDefaultConstructible(int); // expected-note{{candidate constructor}}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
|
||||
|
||||
void foo() {
|
||||
}
|
||||
|
@ -54,6 +56,9 @@ public:
|
|||
S5(int v) : a(v) {}
|
||||
};
|
||||
class S6 { // expected-note 2 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate function (the implicit move assignment operator) not viable: no known conversion from 'int' to 'S6' for 1st argument}}
|
||||
#endif
|
||||
int a;
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -verify -fopenmp %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
|
||||
|
||||
void foo() {
|
||||
}
|
||||
|
@ -55,6 +57,9 @@ public:
|
|||
S5(int v) : a(v) {}
|
||||
};
|
||||
class S6 { // expected-note 2 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
int a;
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 100 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
|
||||
|
||||
void foo() {
|
||||
}
|
||||
|
@ -55,6 +57,9 @@ public:
|
|||
S5(int v) : a(v) {}
|
||||
};
|
||||
class S6 { // expected-note 2 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
int a;
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -verify -fopenmp -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s
|
||||
|
||||
void foo() {
|
||||
}
|
||||
|
@ -55,6 +57,9 @@ public:
|
|||
S5(int v) : a(v) {}
|
||||
};
|
||||
class S6 { // expected-note 2 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
int a;
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 100 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
|
||||
|
||||
void foo() {
|
||||
}
|
||||
|
@ -55,6 +57,9 @@ public:
|
|||
S5(int v) : a(v) {}
|
||||
};
|
||||
class S6 { // expected-note 2 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
int a;
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 100 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 100 -o - %s
|
||||
|
||||
void foo() {
|
||||
}
|
||||
|
@ -55,6 +57,9 @@ public:
|
|||
S5(int v) : a(v) {}
|
||||
};
|
||||
class S6 { // expected-note 2 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
int a;
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 150 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -ferror-limit 150 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -ferror-limit 150 -o - %s
|
||||
|
||||
void foo() {
|
||||
}
|
||||
|
@ -55,6 +57,9 @@ public:
|
|||
S5(int v) : a(v) {}
|
||||
};
|
||||
class S6 { // expected-note 2 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
int a;
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -verify -fopenmp %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++98 %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++11 %s
|
||||
|
||||
void foo() {
|
||||
}
|
||||
|
@ -55,6 +57,9 @@ public:
|
|||
S5(int v) : a(v) {}
|
||||
};
|
||||
class S6 { // expected-note 2 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
int a;
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -verify -fopenmp -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++98 -o - %s
|
||||
// RUN: %clang_cc1 -verify -fopenmp -std=c++11 -o - %s
|
||||
|
||||
void foo() {
|
||||
}
|
||||
|
@ -55,6 +57,9 @@ public:
|
|||
S5(int v) : a(v) {}
|
||||
};
|
||||
class S6 { // expected-note 2 {{candidate function (the implicit copy assignment operator) not viable: no known conversion from 'int' to 'const S6' for 1st argument}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
int a;
|
||||
|
||||
public:
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
// RUN: %clang_cc1 -Wreorder -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -Wreorder -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -Wreorder -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
class A {
|
||||
int m;
|
||||
public:
|
||||
|
@ -98,9 +101,11 @@ struct Current : Derived {
|
|||
// expected-error {{member initializer 'NonExisting' does not name a non-static data member or}}
|
||||
};
|
||||
|
||||
struct M { // expected-note 2 {{candidate constructor (the implicit copy constructor)}} \
|
||||
// expected-note {{declared here}} \
|
||||
// expected-note {{declared here}}
|
||||
struct M { // expected-note 2 {{candidate constructor (the implicit copy constructor)}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
// expected-note@-4 2 {{'M' declared here}}
|
||||
M(int i, int j); // expected-note 2 {{candidate constructor}}
|
||||
};
|
||||
|
||||
|
@ -233,7 +238,13 @@ namespace PR7402 {
|
|||
// <rdar://problem/8308215>: don't crash.
|
||||
// Lots of questionable recovery here; errors can change.
|
||||
namespace test3 {
|
||||
class A : public std::exception {}; // expected-error {{undeclared identifier}} expected-error {{expected class name}} expected-note 2 {{candidate}}
|
||||
class A : public std::exception {}; // expected-error {{undeclared identifier}} expected-error {{expected class name}}
|
||||
// expected-note@-1 {{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-3 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
// expected-note@-5 {{candidate constructor (the implicit default constructor) not viable}}
|
||||
|
||||
class B : public A {
|
||||
public:
|
||||
B(const String& s, int e=0) // expected-error {{unknown type name}}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
class Z { };
|
||||
|
||||
class Y {
|
||||
|
@ -28,6 +31,10 @@ public:
|
|||
};
|
||||
|
||||
class FromShortExplicitly { // expected-note{{candidate constructor (the implicit copy constructor)}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit FromShortExplicitly(short s);
|
||||
};
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
// <rdar://problem/8124080>
|
||||
template<typename _Alloc> class allocator;
|
||||
|
@ -31,7 +33,11 @@ template<typename T> struct a : T {
|
|||
namespace rdar8605381 {
|
||||
struct X {};
|
||||
|
||||
struct Y { // expected-note{{candidate}}
|
||||
struct Y { // expected-note{{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
Y();
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
void f(int i);
|
||||
void f(int i = 0); // expected-note {{previous definition is here}}
|
||||
void f(int i = 17); // expected-error {{redefinition of default argument}}
|
||||
|
@ -23,7 +26,11 @@ struct X {
|
|||
|
||||
void j(X x = 17); // expected-note{{'::j' declared here}}
|
||||
|
||||
struct Y { // expected-note 2{{candidate}}
|
||||
struct Y { // expected-note 2{{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
explicit Y(int);
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
int x(1);
|
||||
int (x2)(1);
|
||||
|
@ -14,6 +16,10 @@ public: explicit Y(float);
|
|||
};
|
||||
|
||||
class X { // expected-note{{candidate constructor (the implicit copy constructor)}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
public:
|
||||
explicit X(int); // expected-note{{candidate constructor}}
|
||||
X(float, float, float); // expected-note{{candidate constructor}}
|
||||
|
@ -21,6 +27,10 @@ public:
|
|||
};
|
||||
|
||||
class Z { // expected-note{{candidate constructor (the implicit copy constructor)}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
public:
|
||||
Z(int); // expected-note{{candidate constructor}}
|
||||
};
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-constant-conversion -std=c++11 %s
|
||||
|
||||
void choice(int);
|
||||
int choice(bool);
|
||||
|
@ -12,6 +14,9 @@ void test() {
|
|||
void f0() {
|
||||
extern void f0_1(int*);
|
||||
register int x;
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-warning@-2 {{'register' storage class specifier is deprecated}}
|
||||
#endif
|
||||
f0_1(&x);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
namespace A { // expected-note 2 {{previous definition is here}}
|
||||
int A;
|
||||
void f() { A = 0; }
|
||||
|
@ -8,8 +11,11 @@ void f() { A = 0; } // expected-error {{unexpected namespace name 'A': expected
|
|||
int A; // expected-error {{redefinition of 'A' as different kind of symbol}}
|
||||
class A; // expected-error {{redefinition of 'A' as different kind of symbol}}
|
||||
|
||||
class B {}; // expected-note {{previous definition is here}} \
|
||||
// expected-note{{candidate function (the implicit copy assignment operator)}}
|
||||
class B {}; // expected-note {{previous definition is here}}
|
||||
// expected-note@-1 {{candidate function (the implicit copy assignment operator) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-3 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
|
||||
void C(); // expected-note {{previous definition is here}}
|
||||
namespace C {} // expected-error {{redefinition of 'C' as different kind of symbol}}
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s -Wnon-pod-varargs
|
||||
class X { }; // expected-note {{the implicit copy constructor}} \
|
||||
// expected-note{{the implicit default constructor}}
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s -Wnon-pod-varargs
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s -Wnon-pod-varargs
|
||||
|
||||
class X { }; // expected-note {{the implicit copy constructor}}
|
||||
// expected-note@-1 {{the implicit default constructor}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-3 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
int& copycon(X x); // expected-note{{passing argument to parameter}}
|
||||
float& copycon(...);
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -fshow-overloads=best -verify -triple x86_64-linux-gnu %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -fshow-overloads=best -verify -triple x86_64-linux-gnu -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -fshow-overloads=best -verify -triple x86_64-linux-gnu -std=c++11 %s
|
||||
|
||||
struct yes;
|
||||
struct no;
|
||||
|
@ -60,7 +62,10 @@ void f(Short s, Long l, Enum1 e1, Enum2 e2, Xpmf pmf) {
|
|||
// FIXME: should pass (void)static_cast<no&>(islong(e1 % e2));
|
||||
}
|
||||
|
||||
struct ShortRef { // expected-note{{candidate function (the implicit copy assignment operator)}}
|
||||
struct ShortRef { // expected-note{{candidate function (the implicit copy assignment operator) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
operator short&();
|
||||
};
|
||||
|
||||
|
@ -68,7 +73,10 @@ struct LongRef {
|
|||
operator volatile long&();
|
||||
};
|
||||
|
||||
struct XpmfRef { // expected-note{{candidate function (the implicit copy assignment operator)}}
|
||||
struct XpmfRef { // expected-note{{candidate function (the implicit copy assignment operator) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
operator pmf&();
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
typedef char char16 __attribute__ ((__vector_size__ (16)));
|
||||
typedef long long longlong16 __attribute__ ((__vector_size__ (16)));
|
||||
typedef char char16_e __attribute__ ((__ext_vector_type__ (16)));
|
||||
|
@ -101,7 +104,10 @@ void casts(longlong16 ll16, longlong16_e ll16e) {
|
|||
}
|
||||
|
||||
template<typename T>
|
||||
struct convertible_to { // expected-note 3 {{candidate function (the implicit copy assignment operator)}}
|
||||
struct convertible_to { // expected-note 3 {{candidate function (the implicit copy assignment operator) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 3 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
operator T() const;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
template<class X> struct A {};
|
||||
|
||||
|
@ -55,7 +57,11 @@ namespace PR7259 {
|
|||
}
|
||||
|
||||
namespace NonDependentError {
|
||||
struct Base { Base(int); }; // expected-note 2{{candidate}}
|
||||
struct Base { Base(int); }; // expected-note {{candidate constructor not viable}}
|
||||
// expected-note@-1 {{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-3 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
struct Derived1 : Base {
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
struct X0 { // expected-note{{candidate}}
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
struct X0 { // expected-note {{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
X0(int); // expected-note{{candidate}}
|
||||
template<typename T> X0(T); // expected-note {{candidate}}
|
||||
template<typename T, typename U> X0(T*, U*); // expected-note {{candidate}}
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
template<typename T>
|
||||
class C { C(int a0 = 0); };
|
||||
|
||||
|
@ -6,6 +9,9 @@ template<>
|
|||
C<char>::C(int a0);
|
||||
|
||||
struct S { }; // expected-note 3 {{candidate constructor (the implicit copy constructor)}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 3 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
template<typename T> void f1(T a, T b = 10) { } // expected-error{{no viable conversion}} \
|
||||
// expected-note{{passing argument to parameter 'b' here}}
|
||||
|
@ -67,7 +73,10 @@ void test_x0(X0<int> xi) {
|
|||
xi.f(17);
|
||||
}
|
||||
|
||||
struct NotDefaultConstructible { // expected-note 2{{candidate}}
|
||||
struct NotDefaultConstructible { // expected-note 2 {{candidate constructor (the implicit copy constructor) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 2 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
NotDefaultConstructible(int); // expected-note 2{{candidate}}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
// Tests that dependent expressions are always allowed, whereas non-dependent
|
||||
// are checked as usual.
|
||||
|
@ -9,6 +11,9 @@
|
|||
namespace std { class type_info {}; }
|
||||
|
||||
struct dummy {}; // expected-note 3 {{candidate constructor (the implicit copy constructor)}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 3 {{candidate constructor (the implicit move constructor) not viable}}
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
int f0(T x) {
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
|
||||
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
|
||||
|
||||
namespace std {
|
||||
template<typename T> class vector { }; // expected-note{{candidate}}
|
||||
template<typename T> class vector { }; // expected-note{{candidate function (the implicit copy assignment operator) not viable}}
|
||||
#if __cplusplus >= 201103L // C++11 or later
|
||||
// expected-note@-2 {{candidate function (the implicit move assignment operator) not viable}}
|
||||
#endif
|
||||
}
|
||||
|
||||
typedef int INT;
|
||||
|
|
Loading…
Reference in New Issue