Skip to content

lambda in unevaluated-context is parsed incorrectedly #51641

Closed
@nickhuang99

Description

@nickhuang99
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));

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions