[LLVMbugs] [Bug 13610] New: narrowing conversion in initializer list not treated as SFINAE condition

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Aug 14 22:57:27 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13610

             Bug #: 13610
           Summary: narrowing conversion in initializer list not treated
                    as SFINAE condition
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: richard-llvm at metafoo.co.uk
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


This code should not compile:

template<typename T> decltype(char{sizeof(T)}) f(T*);
void f(...);
auto x = f((char (*)[1000])0);

... because SFINAE should reject the template due to the narrowing error, and
thus we should pick the variadic and fail when auto type deduction deduces
'void'. But we don't, we pick the template, presumably because the narrowing
case is a DefaultError Warning rather than actually being an Error.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list