aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx0x-decl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-03-12 08:56:40 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-03-12 08:56:40 +0000
commit7796eb5643244f3134834253ce5ea89107ac21c1 (patch)
tree223c93c51604d1e6128470ad42ea5af267b8abaf /test/Parser/cxx0x-decl.cpp
parent69730c115c2d0fec2f20609d905d920a5a41b29b (diff)
Fix parsing of trailing-return-type. Types are syntactically prohibited from
being defined here: [] () -> struct S {} does not define struct S. In passing, implement DR1318 (syntactic disambiguation of 'final'). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152551 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx0x-decl.cpp')
-rw-r--r--test/Parser/cxx0x-decl.cpp10
1 files changed, 10 insertions, 0 deletions
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();
+}