diff options
author | Kaelyn Uhrain <rikka@google.com> | 2012-06-07 23:57:12 +0000 |
---|---|---|
committer | Kaelyn Uhrain <rikka@google.com> | 2012-06-07 23:57:12 +0000 |
commit | b7fe579968a2fad25d95514f96c6649aae519c81 (patch) | |
tree | 3f782e0b7fbc330b083d192ab54be8e9166f4275 /test/FixIt/fixit.cpp | |
parent | ef094a1ab79c57269b627cb19748384d9a26fb31 (diff) |
Teach the FixIt in DiagnoseInvalidRedeclaration how to replace the written
nested name specifiers in addition to the function's identifier when the
correction has a different nested name specifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/FixIt/fixit.cpp')
-rw-r--r-- | test/FixIt/fixit.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/FixIt/fixit.cpp b/test/FixIt/fixit.cpp index 86a2dd4475..f5338cf01b 100644 --- a/test/FixIt/fixit.cpp +++ b/test/FixIt/fixit.cpp @@ -242,3 +242,21 @@ void test() { } } // namespace arrow_suggest + +// Make sure fixing namespace-qualified identifiers functions properly with +// namespace-aware typo correction/ +namespace redecl_typo { +namespace Foo { + void BeEvil(); // expected-note {{'BeEvil' declared here}} +} +namespace Bar { + namespace Foo { + bool isGood(); // expected-note {{'Bar::Foo::isGood' declared here}} + void beEvil(); + } +} +bool Foo::isGood() { // expected-error {{out-of-line definition of 'isGood' does not match any declaration in namespace 'redecl_typo::Foo'; did you mean 'Bar::Foo::isGood'?}} + return true; +} +void Foo::beEvil() {} // expected-error {{out-of-line definition of 'beEvil' does not match any declaration in namespace 'redecl_typo::Foo'; did you mean 'BeEvil'?}} +} |