diff options
author | Reid Kleckner <rnk@google.com> | 2016-02-16 19:16:20 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2016-02-16 19:16:20 +0000 |
commit | eb267f6ce66e53bfe2cc7a6eaea030d4df0bf2da (patch) | |
tree | 0bff13645ec932af13dfd478012edd6e97bad34d /test/SemaCXX/typo-correction-crash.cpp | |
parent | e9d15f0df2ca67b7b57387f30bda4da204adb0a3 (diff) |
[typo-correction] Apply name specifier corrections when forming a NNS
Previously we would leave behind the old name specifier prefix, which
creates an invalid AST. Other callers of CorrectTypo update their
CXXScopeSpec objects with the correction specifier if one is present.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260993 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/typo-correction-crash.cpp')
-rw-r--r-- | test/SemaCXX/typo-correction-crash.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaCXX/typo-correction-crash.cpp b/test/SemaCXX/typo-correction-crash.cpp index f01facd603..6349937ccd 100644 --- a/test/SemaCXX/typo-correction-crash.cpp +++ b/test/SemaCXX/typo-correction-crash.cpp @@ -9,3 +9,11 @@ auto check2() { return "s"; return tes; // expected-error {{use of undeclared identifier 'tes'; did you mean 'test'?}} } + +namespace BarNamespace { +namespace NestedNamespace { // expected-note {{'BarNamespace::NestedNamespace' declared here}} +typedef int type; +} +} +struct FooRecord { }; +FooRecord::NestedNamespace::type x; // expected-error {{no member named 'NestedNamespace' in 'FooRecord'; did you mean 'BarNamespace::NestedNamespace'?}} |