[LLVMbugs] [Bug 18677] New: SFINAE/std::enable_if non-failure in empty variadic parameter declaration

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jan 30 13:12:59 PST 2014


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

            Bug ID: 18677
           Summary: SFINAE/std::enable_if non-failure in empty variadic
                    parameter declaration
           Product: clang
           Version: 3.4
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pab at pabigot.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 11982
  --> http://llvm.org/bugs/attachment.cgi?id=11982&action=edit
Standalone test case demonstrating issue

Attempting to understand why the example at the end of
http://flamingdangerzone.com/cxx11/2013/03/11/overload-ranking.html fails to
work on clang 3.4 I reduced the problem to the attached program.  It shows that
use of:

   template <unsigned N, typename std::enable_if<N!=2>::type...>
   int overloaded (B) { return 2; }

fails to disable the overload when N==2.  With the alternative syntax:

   template <unsigned N, typename = typename std::enable_if<N!=2>::type>
   int overloaded (B) { return 2; }

the overload is correctly disabled.

-- 
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/20140130/09b1b758/attachment.html>


More information about the llvm-bugs mailing list