[llvm-bugs] [Bug 48412] New: [Concepts] Constrained 'decltype(auto)' incorrectly treated as 'auto'

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Dec 6 12:01:00 PST 2020


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

            Bug ID: 48412
           Summary: [Concepts] Constrained 'decltype(auto)' incorrectly
                    treated as 'auto'
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++2a
          Assignee: unassignedclangbugs at nondot.org
          Reporter: arthur.j.odwyer at gmail.com
                CC: blitzrakete at gmail.com, erik.pilkington at gmail.com,
                    llvm-bugs at lists.llvm.org, richard-llvm at metafoo.co.uk

// https://godbolt.org/z/xxeafq

template<class> concept C = true;
int w;
int& r = w;
C decltype(auto) rr = r;  // rr's type should be 'int&', but is 'int'

That is, 'C decltype(auto) rr = r;' SHOULD be treated exactly like
'decltype(auto) rr = r; static_assert(C<decltype(rr)>);' but in fact Clang is
losing the fact that it's supposed to be a reference type.

Bug 48384 is probably related. From the outside, it feels like Clang's parser
is just treating `C decltype(auto)` as a synonym for `C auto` everywhere it
appears.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201206/d0a16b36/attachment.html>


More information about the llvm-bugs mailing list