From aa803409c3bd3930126db630c29f63d42f255153 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 22 May 2017 19:43:45 +0000 Subject: Vendor import of clang trunk r303571: https://llvm.org/svn/llvm-project/cfe/trunk@303571 --- test/SemaCXX/lambda-expressions.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'test/SemaCXX/lambda-expressions.cpp') diff --git a/test/SemaCXX/lambda-expressions.cpp b/test/SemaCXX/lambda-expressions.cpp index e0ab15dc63274..efbb47681ade6 100644 --- a/test/SemaCXX/lambda-expressions.cpp +++ b/test/SemaCXX/lambda-expressions.cpp @@ -525,9 +525,9 @@ template class S {}; void foo() { - const int num = 18; // expected-note {{'num' declared here}} + const int num = 18; auto outer = []() { - auto inner = [](S &X) {}; // expected-error {{variable 'num' cannot be implicitly captured in a lambda with no capture-default specified}} + auto inner = [](S &X) {}; }; } } @@ -573,3 +573,13 @@ void foo1() { auto s1 = S1{[name=name]() {}}; // expected-error {{use of undeclared identifier 'name'; did you mean 'name1'?}} } } + +namespace PR25627_dont_odr_use_local_consts { + + template struct X {}; + + void foo() { + const int N = 10; + (void) [] { X x; }; + } +} -- cgit v1.2.3