]> granicus.if.org Git - clang/commitdiff
[Lit Test] Updated 34 Lit tests to be C++11 compatible.
authorCharles Li <charles_li@playstation.sony.com>
Tue, 17 Nov 2015 20:25:05 +0000 (20:25 +0000)
committerCharles Li <charles_li@playstation.sony.com>
Tue, 17 Nov 2015 20:25:05 +0000 (20:25 +0000)
Added expected diagnostics new to C++11.
Expanded RUN line to: default, C++98/03 and C++11.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253371 91177308-0d34-0410-b5e6-96231b3b80d8

34 files changed:
test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
test/CXX/basic/basic.lookup/basic.lookup.qual/namespace.qual/p2.cpp
test/CXX/basic/basic.scope/basic.scope.hiding/p2.cpp
test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p1.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.stc/p2.cpp
test/CXX/dcl.decl/dcl.init/dcl.init.ref/p5-var.cpp
test/CXX/temp/temp.decls/temp.class/temp.static/p1-inst.cpp
test/CXX/temp/temp.decls/temp.class/temp.static/p1.cpp
test/CXX/temp/temp.param/p3.cpp
test/CXX/temp/temp.spec/temp.explicit/p1.cpp
test/OpenMP/for_reduction_messages.cpp
test/OpenMP/for_simd_reduction_messages.cpp
test/OpenMP/parallel_for_reduction_messages.cpp
test/OpenMP/parallel_for_simd_reduction_messages.cpp
test/OpenMP/parallel_reduction_messages.cpp
test/OpenMP/parallel_sections_reduction_messages.cpp
test/OpenMP/sections_reduction_messages.cpp
test/OpenMP/simd_reduction_messages.cpp
test/OpenMP/teams_reduction_messages.cpp
test/SemaCXX/constructor-initializer.cpp
test/SemaCXX/converting-constructor.cpp
test/SemaCXX/crashes.cpp
test/SemaCXX/default1.cpp
test/SemaCXX/direct-initializer.cpp
test/SemaCXX/expressions.cpp
test/SemaCXX/namespace.cpp
test/SemaCXX/overload-call-copycon.cpp
test/SemaCXX/overloaded-builtin-operators.cpp
test/SemaCXX/vector.cpp
test/SemaTemplate/class-template-ctor-initializer.cpp
test/SemaTemplate/constructor-template.cpp
test/SemaTemplate/default-expr-arguments.cpp
test/SemaTemplate/fun-template-def.cpp
test/SemaTemplate/qualified-names-diag.cpp

index 32dd75ad49a8765ee1352e30b07e093d66fa30c9..2292fc540c48c3cd8d57c6d2b500d76db3d0ec1c 100644 (file)
@@ -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);
index 7918e9f861e4a44f81761797a5d8c31798a3a9ce..ed6c6c0bccf1ea969d1285f1dcf5f9d82236b5ae 100644 (file)
@@ -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}}
   }
index 1d2b525da4c20289dfb3627e29ff57deae2bdd95..bf8df1abee4e137230d14e4a975393308d4c116d 100644 (file)
@@ -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'}}
     }
index bf30ee74a567659816813b0b85423a70963b003a..021c25016c93f13799f0a757d6a320f3a5619577 100644 (file)
@@ -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 {
index 44cc5a7cfaa3a1f09f4b53b54fa4dc6e10adefda..0b7a902f93783a60f1c7cb7b0ded88454d04379b 100644 (file)
@@ -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}}
 }
index cb62874b40cd646e22a01dfef49a37dbfd5a7dd3..382212269772ea89dcb43f95b5a1c44a8649f9ca 100644 (file)
@@ -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 { };
index 9fc4a5809f357193fbbe6b53c7864626b3572d1b..86b2690860c47f567bf65043cd4e7347883e2768 100644 (file)
@@ -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; }
index b0305dd756a65259835e8d10908c00dc973d5d7d..215f48d9d8e6040b5b7c7e2e6912aec410499363 100644 (file)
@@ -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; }
index dc40c4bb909047176e4b2c99e602e2702a5632b0..c3c93396cb13ad300a20ebfe13ad7113bc8111bb 100644 (file)
@@ -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 {
index b42633924e828a7a431d099628e70ed4d4449d2c..5a77d27d5ab68fb5fc182b61cba3570a20baf251 100644 (file)
@@ -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}}
 };
 
index 05368f1a7529400d07966847bd1139c9f5286f35..317f88ce11ba97fbb36c3f55e813b877138abcc7 100644 (file)
@@ -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:
index efa97c5eaee5ca34fb153553c40484455295ae21..000960fb55b535fa063cde6bdf5fb149c21cb0e0 100644 (file)
@@ -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:
index 74808fcb30ed3ad247d425d3ce80a323b1764f11..d64577795e3eafc6ebf9aeaf3998fe437bc2d077 100644 (file)
@@ -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:
index 480f103ef512e6ff089a6e7f4f0b95efae5356d9..f402e74720d89a1227923aa1a11f29e594bb25ee 100644 (file)
@@ -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:
index 9439fed72c492dd9f1fe749c633caa557bb75f43..174924cc81bd51bc96b56a0cd0fc2a140ef1cfa1 100644 (file)
@@ -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:
index ccf67419f902989c46d59621988c871096c7e48d..70f4a8cc2a921d76a56d2bd0e167ea1a477dc81c 100644 (file)
@@ -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:
index 561c45ef2983448fa747cf2023176f498b0b0327..79473d4e5d2897a6c403d758611edf1631126562 100644 (file)
@@ -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:
index 82a966cd3f90d28be703dc40ab0caa7e99de7000..e082921cf38394563eac0548fcd42a5f225ef089 100644 (file)
@@ -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:
index 260cb3320106f6d2e1c9b1de7f2ec1ced1f2c85b..5fb43668f3430e929a0fdac90626927c1999f405 100644 (file)
@@ -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:
index e3ab610da7cae789732d72cd01ea8f7a079d74c2..c5de33cedb90487f45bf60d4781127697667163e 100644 (file)
@@ -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}} 
index 1688e51e73fdf58c299e96590cc1e28fc0cc7861..75002fa585b89310824811dd5fffa6e423792b9a 100644 (file)
@@ -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);
 };
index 12251bba95a43c99103fcced4f798c72a3971771..926d13ab4533c8c25e2351d12292c011b986d434 100644 (file)
@@ -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();
 };
 
index 6001001b11eb9e2cbae53166c8e9305359705134..fcaa2c839d6cbc776eb247fe270a709f45e3febe 100644 (file)
@@ -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);
 };
 
index a7899c75e4dc07571a34e3bee5e9b22213ebc2dc..947622c4e34c9137c588bc666c998c8aad933f9a 100644 (file)
@@ -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}}
 };
index 1a50c99c590471085c6c6d507c3ed31219557164..5a0d6dd0670c908034751b3f93164a66c16c4732 100644 (file)
@@ -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);
 }
 
index d47b7076cec2ea8919b4d66dd34617d76ba11b43..e2c1516ac3aa9d490d6c649a1e4d306fe126f2da 100644 (file)
@@ -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}}
index 6720cb695338494cc0883b149e279cc70f1ecf15..84971024acd82987960a3a471d23ad3444e81456 100644 (file)
@@ -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(...);
index 7899403e2ce3dec4aa830a02cad8de2ea68dab42..4c2953b0b3fe14f159847a4dfb76481ae92869f6 100644 (file)
@@ -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&();
 };
 
index bcd7fedb4df2cc923775f1adcc368dd12cc4de8d..9b272444a23f9a7cd05ea1392c67a3126d4fcb71 100644 (file)
@@ -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;
 };
 
index 6043327b7babe66899316540fc95afc6986be47e..6dae20774585e0dac65cd938965cc29a0fb87355 100644 (file)
@@ -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 {
index c5306a6e32f4a584278d4eaf39870ff6b7c78a1e..ee8475b3cdb81da8661e178a1287f38f09dbaff9 100644 (file)
@@ -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}}
index 14b072a1a5ee22aa59ef17faf588fda0deda14e3..438f5b1aa95f743fe5033fe5fc97ae8ddb4c6a76 100644 (file)
@@ -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}}
 };
 
index 2d515b4b155ade7e833dccd38dbf77ecdae7ae38..037747d35c0de32d0e8b36cca3fcc1ceb3f6a070 100644 (file)
@@ -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) {
index b2df47bfff4cef7f4673d49ce981af4481f28ea8..06b94926c75fdb739a600354902d16b7e5d0ca0e 100644 (file)
@@ -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;