summaryrefslogtreecommitdiffstats
path: root/test/Parser/cxx0x-decl.cpp
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
committerdim <dim@FreeBSD.org>2013-12-22 00:07:40 +0000
commit952eddef9aff85b1e92626e89baaf7a360e2ac85 (patch)
treedf8df0b0067b381eab470a3b8f28d14a552a6340 /test/Parser/cxx0x-decl.cpp
parentea266cad53e3d49771fa38103913d3ec7a166694 (diff)
downloadFreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.zip
FreeBSD-src-952eddef9aff85b1e92626e89baaf7a360e2ac85.tar.gz
Vendor import of clang release_34 branch r197841 (effectively, 3.4 RC3):
https://llvm.org/svn/llvm-project/cfe/branches/release_34@197841
Diffstat (limited to 'test/Parser/cxx0x-decl.cpp')
-rw-r--r--test/Parser/cxx0x-decl.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/test/Parser/cxx0x-decl.cpp b/test/Parser/cxx0x-decl.cpp
index e6cba72..257c56c 100644
--- a/test/Parser/cxx0x-decl.cpp
+++ b/test/Parser/cxx0x-decl.cpp
@@ -73,3 +73,34 @@ enum E
[[]] e;
}
+
+namespace PR5066 {
+ using T = int (*f)(); // expected-error {{type-id cannot have a name}}
+ template<typename T> using U = int (*f)(); // expected-error {{type-id cannot have a name}}
+ auto f() -> int (*f)(); // expected-error {{type-id cannot have a name}}
+ auto g = []() -> int (*f)() {}; // expected-error {{type-id cannot have a name}}
+}
+
+namespace FinalOverride {
+ struct Base {
+ virtual void *f();
+ virtual void *g();
+ virtual void *h();
+ virtual void *i();
+ };
+ struct Derived : Base {
+ virtual auto f() -> void *final;
+ virtual auto g() -> void *override;
+ virtual auto h() -> void *final override;
+ virtual auto i() -> void *override final;
+ };
+}
+
+namespace UsingDeclAttrs {
+ using T __attribute__((aligned(1))) = int;
+ using T [[gnu::aligned(1)]] = int;
+ static_assert(alignof(T) == 1, "");
+
+ using [[gnu::aligned(1)]] T = int; // expected-error {{an attribute list cannot appear here}}
+ using T = int [[gnu::aligned(1)]]; // expected-error {{'aligned' attribute cannot be applied to types}}
+}
OpenPOWER on IntegriCloud