[libcxx] [clang] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)

Dimitry Andric via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 28 09:41:14 PST 2024


DimitryAndric wrote:

FWIW I think I just hit this when building llvm itself (though 15.0.6) with a recent clang, and getting:

```text
/wrkdirs/usr/ports/devel/llvm15/work-default/llvm-project-15.0.7.src/llvm/tools/sancov/sancov.cpp:532:44: error: chosen constructor is explicit in copy-initialization
  532 |       return SpecialCaseList::createOrDie({{ClBlacklist}},
      |                                            ^~~~~~~~~~~~~
/usr/include/c++/v1/string:1047:93: note: explicit constructor declared here
 1047 |   _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t)
      |                                                                                             ^
/usr/include/c++/v1/vector:509:91: note: passing argument to parameter '__il' here
  509 |   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(initializer_list<value_type> __il);
      |                                                                                           ^
/wrkdirs/usr/ports/devel/llvm15/work-default/llvm-project-15.0.7.src/llvm/tools/sancov/sancov.cpp:535:42: error: chosen constructor is explicit in copy-initialization
  535 |     return SpecialCaseList::createOrDie({{ClIgnorelist}},
      |                                          ^~~~~~~~~~~~~~
/usr/include/c++/v1/string:1047:93: note: explicit constructor declared here
 1047 |   _LIBCPP_METHOD_TEMPLATE_IMPLICIT_INSTANTIATION_VIS _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit basic_string(const _Tp& __t)
      |                                                                                             ^
/usr/include/c++/v1/vector:509:91: note: passing argument to parameter '__il' here
  509 |   _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI vector(initializer_list<value_type> __il);
      |                                                                                           ^
2 errors generated.
```

I didn't managed to fully bisect it yet, but it looks very much like 924701311aa79180e86ad8ce43d253f27d25ec7d for this issue is the culprit.

So has that now been reverted, and is the reversal also merged into the 18.x release branch?


https://github.com/llvm/llvm-project/pull/77768


More information about the cfe-commits mailing list