main.cpp2:2:36: error: no viable conversion from 'int' to 'const std::array<int, 1>'
2 | std::array<int,1> inline constexpr arr = (0);
| ^ ~~~
/opt/compiler-explorer/clang-trunk-20230923/bin/../include/c++/v1/array:164:29: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'int' to 'const array<int, 1> &' for 1st argument
164 | struct _LIBCPP_TEMPLATE_VIS array
| ^~~~~
/opt/compiler-explorer/clang-trunk-20230923/bin/../include/c++/v1/array:164:29: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'int' to 'array<int, 1> &&' for 1st argument
164 | struct _LIBCPP_TEMPLATE_VIS array
| ^~~~~
1 error generated.
Title: Object alias lowers to copy-initialization.
Minimal reproducer (https://cpp2.godbolt.org/z/1ea3jsGa8):
Commands:
cppfront main.cpp2 clang++17 -std=c++23 -stdlib=libc++ -lc++abi -pedantic-errors -Wall -Wextra -Wconversion -Werror=unused-result -I . main.cppExpected result:
Actual result and error:
Cpp2 lowered to Cpp1:
Output:
See also: