diff options
Diffstat (limited to 'test/Parser/cxx0x-decl.cpp')
-rw-r--r-- | test/Parser/cxx0x-decl.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp index 3af73f95c78f..b9441fd6813c 100644 --- a/test/Parser/cxx0x-decl.cpp +++ b/test/Parser/cxx0x-decl.cpp @@ -34,3 +34,43 @@ struct MultiCV { }; static_assert(something, ""); // expected-error {{undeclared identifier}} + +// PR9903 +struct SS { + typedef void d() = default; // expected-error {{function definition declared 'typedef'}} expected-error {{only special member functions may be defaulted}} +}; + +using PR14855 = int S::; // expected-error {{expected ';' after alias declaration}} + +// Ensure that 'this' has a const-qualified type in a trailing return type for +// a constexpr function. +struct ConstexprTrailingReturn { + int n; + constexpr auto f() -> decltype((n)); +}; +constexpr const int &ConstexprTrailingReturn::f() const { return n; } + +namespace TestIsValidAfterTypeSpecifier { +struct s {} v; + +// FIXME: We should accept this once we support thread_local. +struct s +thread_local tl; // expected-error {{expected unqualified-id}} + +struct s +&r0 = v; + +struct s +&&r1 = s(); + +struct s +bitand r2 = v; + +struct s +and r3 = s(); + +enum E {}; +enum E +[[]] e; + +} |