Rakete1111 updated this revision to Diff 117054.
Rakete1111 added a comment.
- Fixed test case for bools

Ah got it! Thanks!!


https://reviews.llvm.org/D38342

Files:
  lib/Parse/ParseExpr.cpp
  test/Parser/cxx-bool.cpp


Index: test/Parser/cxx-bool.cpp
===================================================================
--- test/Parser/cxx-bool.cpp
+++ 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"];
+}
+
Index: lib/Parse/ParseExpr.cpp
===================================================================
--- lib/Parse/ParseExpr.cpp
+++ lib/Parse/ParseExpr.cpp
@@ -798,7 +798,8 @@
 
   case tok::kw_true:
   case tok::kw_false:
-    return ParseCXXBoolLiteral();
+    Res = ParseCXXBoolLiteral();
+    break;
   
   case tok::kw___objc_yes:
   case tok::kw___objc_no:


Index: test/Parser/cxx-bool.cpp
===================================================================
--- test/Parser/cxx-bool.cpp
+++ 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"];
+}
+
Index: lib/Parse/ParseExpr.cpp
===================================================================
--- lib/Parse/ParseExpr.cpp
+++ lib/Parse/ParseExpr.cpp
@@ -798,7 +798,8 @@
 
   case tok::kw_true:
   case tok::kw_false:
-    return ParseCXXBoolLiteral();
+    Res = ParseCXXBoolLiteral();
+    break;
   
   case tok::kw___objc_yes:
   case tok::kw___objc_no:
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to