lambda in unevaluated-context is parsed incorrectedly · Issue #51641 · llvm/llvm-project (original) (raw)

Bugzilla Link 52299
Version trunk
OS Linux
CC @AaronBallman,@zygoloid

Extended Description

The following code is accepted incorrectly by clang while GCC and MSVC++ all spot the failure of assertion. The type of "foo" is obviously NOT "void" at all.

template
void foo(decltype(+{}) lambda, T param);

static_assert(__is_same(decltype(foo), void));