aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp2
-rw-r--r--test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p5.cpp2
-rw-r--r--test/CXX/dcl.decl/dcl.meaning/dcl.fct/p9-0x.cpp2
-rw-r--r--test/Parser/cxx0x-ambig.cpp11
-rw-r--r--test/Parser/cxx0x-decl.cpp10
-rw-r--r--test/Parser/cxx0x-lambda-expressions.cpp5
6 files changed, 27 insertions, 5 deletions
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
index 7b5577520d..a385aa9132 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p2.cpp
@@ -44,6 +44,6 @@ struct F : auto(*)()->int {}; // expected-error{{expected class name}}
template<typename T = auto(*)()->int> struct G { };
int g();
-auto (*h)() -> auto = &g; // expected-error{{'auto' not allowed here}}
+auto (*h)() -> auto = &g; // expected-error{{'auto' not allowed in function return type}}
auto (*i)() = &g; // ok; auto deduced as int.
auto (*k)() -> int = i; // ok; no deduction.
diff --git a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p5.cpp b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p5.cpp
index ef48cd00b7..71f57dcc66 100644
--- a/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p5.cpp
+++ b/test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p5.cpp
@@ -65,4 +65,4 @@ template<typename T = auto> struct G { }; // expected-error{{'auto' not allowed
using A = auto; // expected-error{{'auto' not allowed in type alias}}
// FIXME: don't issue the second diagnostic for this error.
-auto k() -> auto; // expected-error{{'auto' not allowed here}} unexpected-error{{without trailing return type}}
+auto k() -> auto; // expected-error{{'auto' not allowed in function return type}} unexpected-error{{without trailing return type}}
diff --git a/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p9-0x.cpp b/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p9-0x.cpp
index 4d71a8e4b4..574a3e7a79 100644
--- a/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p9-0x.cpp
+++ b/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p9-0x.cpp
@@ -1,3 +1,3 @@
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
-auto j() -> enum { e3 }; // expected-error{{can not be defined in a type specifier}}
+auto j() -> enum { e3 }; // expected-error{{unnamed enumeration must be a definition}} expected-error {{requires a specifier or qualifier}} expected-error {{without trailing return type}}
diff --git a/test/Parser/cxx0x-ambig.cpp b/test/Parser/cxx0x-ambig.cpp
index c955dc1690..b77bae500e 100644
--- a/test/Parser/cxx0x-ambig.cpp
+++ b/test/Parser/cxx0x-ambig.cpp
@@ -5,15 +5,24 @@
// final 'context sensitive' mess.
namespace final {
struct S { int n; };
+ struct T { int n; };
namespace N {
int n;
+ // These declare variables named final..
+ extern struct S final;
+ extern struct S final [[]];
+ extern struct S final, foo;
+ struct S final = S();
+
// This defines a class, not a variable, even though it would successfully
// parse as a variable but not as a class. DR1318's wording suggests that
// this disambiguation is only performed on an ambiguity, but that was not
// the intent.
- struct S final {
+ struct S final { // expected-note {{here}}
int(n) // expected-error {{expected ';'}}
};
+ // This too.
+ struct T final : S {}; // expected-error {{base 'S' is marked 'final'}}
}
}
diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp
index 73aa3fdc40..b9f5141a53 100644
--- a/test/Parser/cxx0x-decl.cpp
+++ b/test/Parser/cxx0x-decl.cpp
@@ -6,3 +6,13 @@ namespace Commas {
b [[ ]],
c alignas(double);
}
+
+struct S {};
+enum E { e };
+
+auto f() -> struct S {
+ return S();
+}
+auto g() -> enum E {
+ return E();
+}
diff --git a/test/Parser/cxx0x-lambda-expressions.cpp b/test/Parser/cxx0x-lambda-expressions.cpp
index 87d14051e9..9c71941421 100644
--- a/test/Parser/cxx0x-lambda-expressions.cpp
+++ b/test/Parser/cxx0x-lambda-expressions.cpp
@@ -1,5 +1,7 @@
// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -verify -std=c++11 %s
+enum E { e };
+
class C {
int f() {
@@ -19,6 +21,8 @@ class C {
[=,&foo] () {};
[&,foo] () {};
[this] () {};
+ [] () -> class C { return C(); };
+ [] () -> enum E { return e; };
[] -> int { return 0; }; // expected-error{{lambda requires '()' before return type}}
[] mutable -> int { return 0; }; // expected-error{{lambda requires '()' before 'mutable'}}
@@ -37,4 +41,3 @@ class C {
int a6[1] = {[this] = 1 }; // expected-error{{integral constant expression must have integral or unscoped enumeration type, not 'C *'}}
}
};
-