diff options
Diffstat (limited to 'clang/test/SemaCXX/typo-correction-delayed.cpp')
| -rw-r--r-- | clang/test/SemaCXX/typo-correction-delayed.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/typo-correction-delayed.cpp b/clang/test/SemaCXX/typo-correction-delayed.cpp index d303b58554d..d42888f1e6a 100644 --- a/clang/test/SemaCXX/typo-correction-delayed.cpp +++ b/clang/test/SemaCXX/typo-correction-delayed.cpp @@ -119,3 +119,23 @@ class SomeClass { public: explicit SomeClass() : Kind(kSum) {} // expected-error {{use of undeclared identifier 'kSum'; did you mean 'kNum'?}} }; + +extern "C" int printf(const char *, ...); + +// There used to be an issue with typo resolution inside overloads. +struct AssertionResult { + ~AssertionResult(); + operator bool(); + int val; +}; +AssertionResult Compare(const char *a, const char *b); +AssertionResult Compare(int a, int b); +int main() { + // expected-note@+1 {{'result' declared here}} + const char *result; + // expected-error@+1 {{use of undeclared identifier 'resulta'; did you mean 'result'?}} + if (AssertionResult ar = (Compare("value1", resulta))) + ; + else + printf("ar: %d\n", ar.val); +} |

