Skip to content

[Clang][C++20] CTAD on aggregates fails with designated initializers #83368

@duk-37

Description

@duk-37
template <int N>
struct A { int f1[N]; };

int main() {
    A a1{ {1} }; // compiles fine
    A a2{ .f1 = {1} }; // error: no viable constructor or deduction guide for deduction of template arguments of 'T'
}

MSVC errors here too, GCC works.

Compiler Explorer

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions