https://bugs.llvm.org/show_bug.cgi?id=48526

            Bug ID: 48526
           Summary: Correct example from [dcl.init] yields error
           Product: clang
           Version: 11.0
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++2a
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected]

C++20 in [dcl.init] clause (17.6.2.2) have an example of what can happen with
different initialization of structure:

struct A { int a; int&& b; };

including these:

A a2(1, f()); // well-formed, but dangling reference
A a4(1.0, 1); // well-formed, but dangling reference

I simplified this a bit to

A a4(1, 2);

GCC works as expected:

https://godbolt.org/z/EE4rKK

But clang fails on both lines and produces error

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to