diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-02-02 22:24:54 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-02-02 22:24:54 +0000 |
| commit | e303e3523a9b6a2bfd2646f350f2fefd50afdc18 (patch) | |
| tree | cee8cf637bef0dab3227416232c3200e0b50d3f5 /clang/test | |
| parent | 6a8e79b8e5b826c861cd7d33c7e2876a4138459b (diff) | |
| download | bcm5719-llvm-e303e3523a9b6a2bfd2646f350f2fefd50afdc18.tar.gz bcm5719-llvm-e303e3523a9b6a2bfd2646f350f2fefd50afdc18.zip | |
Add missing direct-init / parameter-declaration-clause disambiguation when
parsing a trailing-return-type of a (function pointer) variable declaration.
llvm-svn: 324151
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Parser/cxx-ambig-decl-expr.cpp | 4 | ||||
| -rw-r--r-- | clang/test/Parser/cxx0x-decl.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/clang/test/Parser/cxx-ambig-decl-expr.cpp b/clang/test/Parser/cxx-ambig-decl-expr.cpp index feb185fbe3f..7bf08b02c4f 100644 --- a/clang/test/Parser/cxx-ambig-decl-expr.cpp +++ b/clang/test/Parser/cxx-ambig-decl-expr.cpp @@ -11,3 +11,7 @@ void f() { unknown *p = 0; // expected-error {{unknown type name 'unknown'}} unknown * p + 0; // expected-error {{undeclared identifier 'unknown'}} } + +auto (*p)() -> int(nullptr); +auto (*q)() -> int(*)(unknown); // expected-error {{unknown type name 'unknown'}} +auto (*r)() -> int(*)(unknown + 1); // expected-error {{undeclared identifier 'unknown'}} diff --git a/clang/test/Parser/cxx0x-decl.cpp b/clang/test/Parser/cxx0x-decl.cpp index 2b253c019c9..1eaf84a471e 100644 --- a/clang/test/Parser/cxx0x-decl.cpp +++ b/clang/test/Parser/cxx0x-decl.cpp @@ -79,7 +79,7 @@ enum 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 f() -> int (*f)(); // expected-error {{only variables can be initialized}} expected-error {{expected ';'}} auto g = []() -> int (*f)() {}; // expected-error {{type-id cannot have a name}} } |

