[PATCH] D156032: Implement CWG2137 (list-initialization from objects of the same type)

Mital Ashok via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jul 23 10:30:55 PDT 2023


MitalAshok added inline comments.


================
Comment at: clang/test/CXX/drs/dr14xx.cpp:433
-    S s1;
-    S s2 = {s1}; // ok, not list-initialization so we pick the non-explicit constructor
-  }
----------------
This relies on the old wording. "If T is a class type and the initializer list has a single element of type cv U, where U is T or a class derived from T, the object is initialized from that element (by copy-initialization for copy-list-initialization, or by direct-initialization for direct-list-initialization)".

"If T is a class type" -> "If T is an aggregate class type", so this copy-list-initialization remains copy-list-initialization (and should fail for picking the explicit constructor)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D156032/new/

https://reviews.llvm.org/D156032



More information about the cfe-commits mailing list