diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-10-15 00:00:26 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-10-15 00:00:26 +0000 |
commit | fb8b7b9a1c524c420728d1814997d6e988f992de (patch) | |
tree | 020250997da147b7c85dad004ee0f34e06bfa89b /clang/test/Parser/cxx0x-in-cxx98.cpp | |
parent | b0cba4ce7570727d30510946b38588265a14efb1 (diff) | |
download | bcm5719-llvm-fb8b7b9a1c524c420728d1814997d6e988f992de.tar.gz bcm5719-llvm-fb8b7b9a1c524c420728d1814997d6e988f992de.zip |
PR17567: Improve diagnostic for a mistyped constructor name. If we see something
that looks like a function declaration, except that it's missing a return type,
try typo-correcting it to the relevant constructor name.
In passing, fix a bug where the missing-type-specifier recovery codepath would
drop a preceding scope specifier on the floor, leading to follow-on diagnostics
and incorrect recovery for the auto-in-c++98 hack.
llvm-svn: 192644
Diffstat (limited to 'clang/test/Parser/cxx0x-in-cxx98.cpp')
-rw-r--r-- | clang/test/Parser/cxx0x-in-cxx98.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx0x-in-cxx98.cpp b/clang/test/Parser/cxx0x-in-cxx98.cpp index b4bda89d278..72499381163 100644 --- a/clang/test/Parser/cxx0x-in-cxx98.cpp +++ b/clang/test/Parser/cxx0x-in-cxx98.cpp @@ -21,3 +21,10 @@ void NewBracedInitList() { // A warning on this would be sufficient once we can handle it correctly. new int {}; // expected-error {{}} } + +struct Auto { + static int n; +}; +auto Auto::n = 0; // expected-warning {{'auto' type specifier is a C++11 extension}} +auto Auto::m = 0; // expected-error {{no member named 'm' in 'Auto'}} + // expected-warning@-1 {{'auto' type specifier is a C++11 extension}} |