On 1/25/24 14:18, Patrick Palka wrote:
Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/13? This isn't a very satisfactory fix, but at least it safely fixes these testcases I guess. Note that there's implementation disagreement about the second testcase, GCC always accepted it but Clang/MSVC/icc reject it.
Because of trying to initialize int& from {c}; removing the extra braces makes it work everywhore.
https://eel.is/c++draft/dcl.init#list-3.10 says that we always generate a prvalue in this case, so perhaps we shouldn't recalculate if the initializer is an init-list?
The first testcase is special because it's a C-style cast; seems like the maybe_valid = false heuristics should be disabled if c_cast_p.
Jason