[clang] 9a5dc01 - [clang][PATCH][NFC] Correct test case related to review D95482

Melanie Blower via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 2 07:07:04 PST 2021


Author: Melanie Blower
Date: 2021-02-02T07:06:43-08:00
New Revision: 9a5dc01e4b65b15c73751f5b3d9273ea73533b5d

URL: https://github.com/llvm/llvm-project/commit/9a5dc01e4b65b15c73751f5b3d9273ea73533b5d
DIFF: https://github.com/llvm/llvm-project/commit/9a5dc01e4b65b15c73751f5b3d9273ea73533b5d.diff

LOG: [clang][PATCH][NFC] Correct test case related to review D95482

Added: 
    clang/test/SemaCXX/pr48848.cpp

Modified: 
    clang/test/SemaCXX/lambda-expressions.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/SemaCXX/lambda-expressions.cpp b/clang/test/SemaCXX/lambda-expressions.cpp
index 03bf13733d7b..22e0939379f5 100644
--- a/clang/test/SemaCXX/lambda-expressions.cpp
+++ b/clang/test/SemaCXX/lambda-expressions.cpp
@@ -1,8 +1,6 @@
 // RUN: %clang_cc1 -std=c++14 -Wno-unused-value -fsyntax-only -verify -verify=expected-cxx14 -fblocks %s
 // RUN: %clang_cc1 -std=c++17 -Wno-unused-value -fsyntax-only -verify -fblocks %s
-// RUN: %clang_cc1 -std=c++17 -fblocks -DSHOW_MS -Wno-unused-value -fms-compatibility -fdelayed-template-parsing -fsyntax-only -verify %s
 
-#ifndef SHOW_MS
 namespace std { class type_info; };
 
 namespace ExplicitCapture {
@@ -666,22 +664,3 @@ void Test() {
 
 }
 };
-
-#else
-template <typename RT, typename ET>
-void Decider(const RT &sp, ET &ep) {
-  [=](auto i) { ep[i] = sp[i + j]; };
-    // expected-error at -1 {{use of undeclared identifier 'j'}}
-}
-
-template <typename EMT> void LS() {
-  int *ep;
-  Decider(5, ep);
-}
-
-void runChapter4()
-{
-  LS<int>(); // expected-note {{in instantiation of}}
-}
-
-#endif

diff  --git a/clang/test/SemaCXX/pr48848.cpp b/clang/test/SemaCXX/pr48848.cpp
new file mode 100644
index 000000000000..064dbb137082
--- /dev/null
+++ b/clang/test/SemaCXX/pr48848.cpp
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -std=c++17 -fblocks -DSHOW_MS -Wno-unused-value -fms-compatibility -fdelayed-template-parsing -fsyntax-only -verify %s
+template <typename RT, typename ET>
+void Decider(const RT &sp, ET &ep) {
+  [=](auto i) { ep[i] = sp[i + j]; };
+  // expected-error at -1 {{use of undeclared identifier 'j'}}
+}
+
+template <typename EMT> void LS() {
+  int *ep;
+  Decider(5, ep);
+}
+
+void runChapter4() {
+  LS<int>(); // expected-note {{in instantiation of}}
+}


        


More information about the cfe-commits mailing list