diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-05-14 01:58:49 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-05-14 01:58:49 +0000 |
| commit | 9385d704c115891e0beae99f46cc1df2de8bc5f6 (patch) | |
| tree | 6b8e6bc3e73b9474f811d270c28d0e09f911bbe8 /clang/test/SemaCXX/using-decl-1.cpp | |
| parent | 81ef0e1adbdb457113623b6469844ae6616bb5e5 (diff) | |
| download | bcm5719-llvm-9385d704c115891e0beae99f46cc1df2de8bc5f6.tar.gz bcm5719-llvm-9385d704c115891e0beae99f46cc1df2de8bc5f6.zip | |
When typo-correcting a using-declaration, actually correct the name of the
UsingDecl (so that redeclaration lookup can find it).
llvm-svn: 269530
Diffstat (limited to 'clang/test/SemaCXX/using-decl-1.cpp')
| -rw-r--r-- | clang/test/SemaCXX/using-decl-1.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/using-decl-1.cpp b/clang/test/SemaCXX/using-decl-1.cpp index e17612d277c..93f38f28e77 100644 --- a/clang/test/SemaCXX/using-decl-1.cpp +++ b/clang/test/SemaCXX/using-decl-1.cpp @@ -243,6 +243,41 @@ namespace PR19171 { struct F : E { using E::EE; // expected-error-re {{no member named 'EE' in 'PR19171::E'{{$}}}} }; + + struct TypoDuplicate { // expected-note 0-4{{here}} + TypoDuplicate(int); + void foobar(); // expected-note 2{{here}} + }; + struct TypoDuplicateDerived1 : TypoDuplicate { +#if __cplusplus >= 201103L + using TypoDuplicate::TypoFuplicate; // expected-error {{did you mean 'TypoDuplicate'}} expected-note {{previous}} + using TypoDuplicate::TypoDuplicate; // expected-error {{redeclaration}} +#endif + using TypoDuplicate::goobar; // expected-error {{did you mean 'foobar'}} expected-note {{previous}} + using TypoDuplicate::foobar; // expected-error {{redeclaration}} + }; + struct TypoDuplicateDerived2 : TypoDuplicate { +#if __cplusplus >= 201103L + using TypoFuplicate::TypoDuplicate; // expected-error {{did you mean 'TypoDuplicate'}} expected-note {{previous}} + using TypoDuplicate::TypoDuplicate; // expected-error {{redeclaration}} +#endif + }; + struct TypoDuplicateDerived3 : TypoDuplicate { +#if __cplusplus >= 201103L + // FIXME: Don't suggest a correction that would lead to a redeclaration + // error here... or at least diagnose the error. + using TypoDuplicate::TypoDuplicate; + using TypoDuplicate::TypoFuplicate; // expected-error {{did you mean 'TypoDuplicate'}} +#endif + using TypoDuplicate::foobar; + using TypoDuplicate::goobar; // expected-error {{did you mean 'foobar'}} + }; + struct TypoDuplicateDerived4 : TypoDuplicate { +#if __cplusplus >= 201103L + using TypoDuplicate::TypoDuplicate; // expected-note {{previous}} + using TypoFuplicate::TypoDuplicate; // expected-error {{did you mean 'TypoDuplicate'}} expected-error {{redeclaration}} +#endif + }; } namespace TypoCorrectTemplateMember { |

