summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Parse/ParseExpr.cpp3
-rw-r--r--test/Parser/cxx-bool.cpp9
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index 6098563340..5e0688ca58 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -798,7 +798,8 @@ ExprResult Parser::ParseCastExpression(bool isUnaryExpression,
case tok::kw_true:
case tok::kw_false:
- return ParseCXXBoolLiteral();
+ Res = ParseCXXBoolLiteral();
+ break;
case tok::kw___objc_yes:
case tok::kw___objc_no:
diff --git a/test/Parser/cxx-bool.cpp b/test/Parser/cxx-bool.cpp
index a8a161edb1..21591d10e9 100644
--- a/test/Parser/cxx-bool.cpp
+++ b/test/Parser/cxx-bool.cpp
@@ -1,4 +1,11 @@
-// RUN: %clang_cc1 -fsyntax-only %s
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// expected-no-diagnostics
bool a = true;
bool b = false;
+
+namespace pr34273 {
+ char c = "clang"[true];
+ char d = true["clang"];
+}
+