aboutsummaryrefslogtreecommitdiff
path: root/test/CXX
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-04-17 16:25:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-04-17 16:25:20 +0000
commit7974c60375b2b9dfc20defc77c9ed8c3d6d241a1 (patch)
treeecabd74def1bb4e85b455bbde3a97094582fd4d5 /test/CXX
parent076eea20b80024fc63bbd71fb019375983680ea6 (diff)
DR974: Lambdas can have default arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179688 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX')
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp2
-rw-r--r--test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp8
2 files changed, 4 insertions, 6 deletions
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp
index 5dac886d4d..38d5d0a6cd 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/default-arguments.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -Wno-lambda-extensions -verify
+// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -verify
void defargs() {
auto l1 = [](int i, int j = 17, int k = 18) { return i + j + k; };
diff --git a/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp b/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
index 9dffc1ff26..dc2c209af2 100644
--- a/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
+++ b/test/CXX/expr/expr.prim/expr.prim.lambda/p5.cpp
@@ -39,12 +39,10 @@ void test_quals() {
bogus_override_if_virtual<decltype(l)> bogus;
}
-// Default arguments (8.3.6) shall not be specified in the
-// parameter-declaration-clause of a lambda- declarator.
-// Note: Removed by core issue 974.
+// Core issue 974: default arguments (8.3.6) may be specified in the
+// parameter-declaration-clause of a lambda-declarator.
int test_default_args() {
- return [](int i = 5, // expected-warning{{C++11 forbids default arguments for lambda expressions}}
- int j = 17) { return i+j;}(5, 6);
+ return [](int i = 5, int j = 17) { return i+j;}(5, 6);
}
// Any exception-specification specified on a lambda-expression