[llvm-bugs] [Bug 50578] New: Integral promotion on incomplete enum types

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jun 4 04:01:21 PDT 2021


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

            Bug ID: 50578
           Summary: Integral promotion on incomplete enum types
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rs2740 at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

int f(int);
template<class E>
E&& g();
enum E {
    e = decltype(f(g<E>()))(42),
};

This is rejected by clang 9 and accepted since 10.

Initialization of the parameter of f involves an lvalue-to-rvalue conversion on
g<E>() followed by an integral promotion. The former should be ill-formed by
[conv.lval]p1:

A glvalue of a non-function, non-array type T can be converted to a prvalue. If
T is an incomplete type, a program that necessitates this conversion is
ill-formed.

-- 
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/20210604/d22750f6/attachment.html>


More information about the llvm-bugs mailing list