You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
…_enum`
Simplifying `enum` and `flag_enum` needed:
- evolving the `==` compile-time alias design to be the way we we express compile-time `constexpr` functions and objects
- including to work around Cpp1's limitation on declaring `constexpr`/`inline`/`static` members of a type that have an incomplete type, including the same type being defined, by using the dance described in https://stackoverflow.com/questions/11928089/
- enabling emitting `operator<<` as a `friend` function
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.cpp
Expected result:
Actual result and error:
Cpp2 lowered to Cpp1:
Output:
See also:
The text was updated successfully, but these errors were encountered: