aboutsummaryrefslogtreecommitdiff
path: root/test/CXX/dcl.decl
diff options
context:
space:
mode:
Diffstat (limited to 'test/CXX/dcl.decl')
-rw-r--r--test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p4.cpp6
-rw-r--r--test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp1
-rw-r--r--test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp1
-rw-r--r--test/CXX/dcl.decl/dcl.init/dcl.init.string/p1.cpp1
-rw-r--r--test/CXX/dcl.decl/dcl.init/p7.cpp14
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p2.cpp1
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp6
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct/p14.cpp1
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.ref/p6-0x.cpp1
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/p1.cpp14
-rw-r--r--test/CXX/dcl.decl/dcl.name/p1.cpp1
-rw-r--r--test/CXX/dcl.decl/p4-0x.cpp1
12 files changed, 38 insertions, 10 deletions
diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p4.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p4.cpp
index 104157115335..2342807692e6 100644
--- a/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p4.cpp
+++ b/test/CXX/dcl.decl/dcl.init/dcl.init.aggr/p4.cpp
@@ -16,3 +16,9 @@ void tf() {
// Allowed by GNU extension
int a4[] = {}; // expected-error {{zero size arrays}}
+
+struct Incomplete; // expected-note {{forward declaration of 'Incomplete'}}
+struct A {
+ Incomplete i; // expected-error {{field has incomplete type 'Incomplete'}}
+};
+A a[] = { 0 }; // PR13971: don't hang.
diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp
index 885d11b9c24a..2c9cd88e40bf 100644
--- a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp
+++ b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/basic.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
// PR5787
class C {
diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp
index 20c059eab6f3..76053f028e2b 100644
--- a/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp
+++ b/test/CXX/dcl.decl/dcl.init/dcl.init.ref/p1.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
+// expected-no-diagnostics
int g(int);
void f() {
int i;
diff --git a/test/CXX/dcl.decl/dcl.init/dcl.init.string/p1.cpp b/test/CXX/dcl.decl/dcl.init/dcl.init.string/p1.cpp
index 3631af1b7fd2..878d2c68ec33 100644
--- a/test/CXX/dcl.decl/dcl.init/dcl.init.string/p1.cpp
+++ b/test/CXX/dcl.decl/dcl.init/dcl.init.string/p1.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
char x1[]("hello");
extern char x1[6];
diff --git a/test/CXX/dcl.decl/dcl.init/p7.cpp b/test/CXX/dcl.decl/dcl.init/p7.cpp
new file mode 100644
index 000000000000..03216f4c28ac
--- /dev/null
+++ b/test/CXX/dcl.decl/dcl.init/p7.cpp
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -std=c++11 -verify %s
+
+struct NotAggregateBase {};
+
+struct A : NotAggregateBase {
+private:
+ A() = default; // expected-note {{here}}
+};
+A a = {}; // expected-error {{calling a private constructor}}
+
+struct B : NotAggregateBase {
+ explicit B() = default; // expected-note {{here}}
+};
+B b = {}; // expected-error {{chosen constructor is explicit}}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p2.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p2.cpp
index 0a107eb2b139..68aabca71eac 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p2.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p2.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
void point(int = 3, int = 4);
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp
index e9c5e0ca7b69..5467a9222c07 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.fct.default/p3.cpp
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
-void nondecl(int (*f)(int x = 5)) // {expected-error {{default arguments can only be specified}}}
+void nondecl(int (*f)(int x = 5)) // expected-error {{default arguments can only be specified}}
{
- void (*f2)(int = 17) // {expected-error {{default arguments can only be specified}}}
- = (void (*)(int = 42))f; // {expected-error {{default arguments can only be specified}}}
+ void (*f2)(int = 17) // expected-error {{default arguments can only be specified}}
+ = (void (*)(int = 42))f; // expected-error {{default arguments can only be specified}}
}
struct X0 {
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p14.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p14.cpp
index 0e69521fbdfc..bc249b5a087b 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p14.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p14.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T> struct identity;
template<typename ...Types> struct tuple;
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.ref/p6-0x.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.ref/p6-0x.cpp
index 4ce80bc35ac9..cd623df71e81 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.ref/p6-0x.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.ref/p6-0x.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
template<typename T, typename U>
struct is_same {
diff --git a/test/CXX/dcl.decl/dcl.meaning/p1.cpp b/test/CXX/dcl.decl/dcl.meaning/p1.cpp
index 3672ea0ea086..ec9a2611872c 100644
--- a/test/CXX/dcl.decl/dcl.meaning/p1.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/p1.cpp
@@ -7,7 +7,7 @@ namespace PR8019 {
struct PR8019::x { int x; }; // expected-error{{non-friend class member 'x' cannot have a qualified name}}
struct inner;
- struct y::inner { }; // expected-warning{{extra qualification on member 'inner'}}
+ struct y::inner { }; // expected-error{{extra qualification on member 'inner'}}
template<typename T>
struct PR8019::x2 { }; // expected-error{{non-friend class member 'x2' cannot have a qualified name}}
@@ -16,7 +16,7 @@ namespace PR8019 {
struct inner_template;
template<typename T>
- struct y::inner_template { }; // expected-warning{{extra qualification on member 'inner_template'}}
+ struct y::inner_template { }; // expected-error{{extra qualification on member 'inner_template'}}
};
}
@@ -29,9 +29,9 @@ namespace NS {
template<typename T> void wibble(T);
}
namespace NS {
- void NS::foo() {} // expected-warning{{extra qualification on member 'foo'}}
- int NS::bar; // expected-warning{{extra qualification on member 'bar'}}
- struct NS::X { }; // expected-warning{{extra qualification on member 'X'}}
- template<typename T> struct NS::Y; // expected-warning{{extra qualification on member 'Y'}}
- template<typename T> void NS::wibble(T) { } // expected-warning{{extra qualification on member 'wibble'}}
+ void NS::foo() {} // expected-error{{extra qualification on member 'foo'}}
+ int NS::bar; // expected-error{{extra qualification on member 'bar'}}
+ struct NS::X { }; // expected-error{{extra qualification on member 'X'}}
+ template<typename T> struct NS::Y; // expected-error{{extra qualification on member 'Y'}}
+ template<typename T> void NS::wibble(T) { } // expected-error{{extra qualification on member 'wibble'}}
}
diff --git a/test/CXX/dcl.decl/dcl.name/p1.cpp b/test/CXX/dcl.decl/dcl.name/p1.cpp
index 9838b4f4737d..e032a7f92a5c 100644
--- a/test/CXX/dcl.decl/dcl.name/p1.cpp
+++ b/test/CXX/dcl.decl/dcl.name/p1.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
namespace pr6200 {
struct v {};
diff --git a/test/CXX/dcl.decl/p4-0x.cpp b/test/CXX/dcl.decl/p4-0x.cpp
index 98c33b25f4d2..35177a038697 100644
--- a/test/CXX/dcl.decl/p4-0x.cpp
+++ b/test/CXX/dcl.decl/p4-0x.cpp
@@ -1,4 +1,5 @@
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
+// expected-no-diagnostics
struct X {
void f() &;