Files
clang-p2996/clang/test/CXX/expr/expr.prim/expr.prim.lambda/p9.cpp
Aaron Ballman a2b04ad5c4 Mark the lambda function pointer conversion operator as noexcept.
This implements CWG DR 1722 and fixes PR40309. Patch by Ignat Loskutov.

llvm-svn: 351750
2019-01-21 16:25:08 +00:00

9 lines
294 B
C++

// RUN: %clang_cc1 -fsyntax-only -std=c++17 %s -verify
// expected-no-diagnostics
void test_noexcept() {
const auto lambda = [](int x) { return x + 1; };
static_assert(noexcept((int (*)(int))(lambda)),
"Lambda-to-function-pointer conversion is expected to be noexcept");
}