From: Melanie Blower Date: Tue, 2 Feb 2021 15:06:25 +0000 (-0800) Subject: [clang][PATCH][NFC] Correct test case related to review D95482 X-Git-Tag: llvmorg-14-init~16278 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9a5dc01e4b65b15c73751f5b3d9273ea73533b5d;p=platform%2Fupstream%2Fllvm.git [clang][PATCH][NFC] Correct test case related to review D95482 --- diff --git a/clang/test/SemaCXX/lambda-expressions.cpp b/clang/test/SemaCXX/lambda-expressions.cpp index 03bf137..22e0939 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 -void Decider(const RT &sp, ET &ep) { - [=](auto i) { ep[i] = sp[i + j]; }; - // expected-error@-1 {{use of undeclared identifier 'j'}} -} - -template void LS() { - int *ep; - Decider(5, ep); -} - -void runChapter4() -{ - LS(); // 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 0000000..064dbb1 --- /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 +void Decider(const RT &sp, ET &ep) { + [=](auto i) { ep[i] = sp[i + j]; }; + // expected-error@-1 {{use of undeclared identifier 'j'}} +} + +template void LS() { + int *ep; + Decider(5, ep); +} + +void runChapter4() { + LS(); // expected-note {{in instantiation of}} +}