From: Reid Kleckner Date: Sat, 13 Dec 2014 01:11:23 +0000 (+0000) Subject: Implement feedback on r224172 in PR21899 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9e65ba19dcd57ca74eb739042d39aeca83983fa;p=platform%2Fupstream%2Fllvm.git Implement feedback on r224172 in PR21899 Based on suggestions from Kaelyn. llvm-svn: 224173 --- diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 554e8c9..ad376f1 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -6105,7 +6105,7 @@ public: auto Result = BaseTransform::RebuildCallExpr(Callee, LParenLoc, Args, RParenLoc, ExecConfig); if (auto *OE = dyn_cast(Callee)) { - if (!Result.isInvalid() && Result.get()) { + if (Result.isUsable()) { Expr *ResultCall = Result.get(); if (auto *BE = dyn_cast(ResultCall)) ResultCall = BE->getSubExpr(); diff --git a/clang/test/SemaCXX/typo-correction-delayed.cpp b/clang/test/SemaCXX/typo-correction-delayed.cpp index d42888f..7879d29 100644 --- a/clang/test/SemaCXX/typo-correction-delayed.cpp +++ b/clang/test/SemaCXX/typo-correction-delayed.cpp @@ -120,22 +120,13 @@ 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() { +struct AssertionResult { ~AssertionResult(); }; +AssertionResult Overload(const char *a); +AssertionResult Overload(int a); +void UseOverload() { // 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); + Overload(resulta); }