summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2014-12-13 01:11:23 +0000
committerReid Kleckner <reid@kleckner.net>2014-12-13 01:11:23 +0000
commita9e65ba19dcd57ca74eb739042d39aeca83983fa (patch)
tree01cce002e28d285b8cc53ca2c318ff156e0f97b1
parenta7fe33e0f6e2ad24bb45e292c51f6cb6e27b377e (diff)
downloadbcm5719-llvm-a9e65ba19dcd57ca74eb739042d39aeca83983fa.tar.gz
bcm5719-llvm-a9e65ba19dcd57ca74eb739042d39aeca83983fa.zip
Implement feedback on r224172 in PR21899
Based on suggestions from Kaelyn. llvm-svn: 224173
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp2
-rw-r--r--clang/test/SemaCXX/typo-correction-delayed.cpp19
2 files changed, 6 insertions, 15 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index 554e8c9b8fd..ad376f12542 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<OverloadExpr>(Callee)) {
- if (!Result.isInvalid() && Result.get()) {
+ if (Result.isUsable()) {
Expr *ResultCall = Result.get();
if (auto *BE = dyn_cast<CXXBindTemporaryExpr>(ResultCall))
ResultCall = BE->getSubExpr();
diff --git a/clang/test/SemaCXX/typo-correction-delayed.cpp b/clang/test/SemaCXX/typo-correction-delayed.cpp
index d42888f1e6a..7879d299d08 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);
}
OpenPOWER on IntegriCloud