[llvm-bugs] [Bug 45331] New: clang incorrectly truncates integer in list initialization in SFINAE context

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Mar 27 09:33:00 PDT 2020


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

            Bug ID: 45331
           Summary: clang incorrectly truncates integer in list
                    initialization in SFINAE context
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: efriedma at quicinc.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

struct A { signed char a; constexpr A(signed char a) : a(a) {} };
template<int x> constexpr A f(int y, int (*z)[A{x}.a] = 0) { return A(1); }
template<int x> constexpr A f(char* y) { return A(2); }
static_assert(f<257>(0).a == 2, "Should pick second overload");

gcc accepts, clang rejects.  I think gcc is right?

-- 
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/20200327/c26eb86d/attachment.html>


More information about the llvm-bugs mailing list