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

            Bug ID: 32606
           Summary: std::decay mishandles abominable function types
           Product: libc++
           Version: 4.0
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: rs2...@gmail.com
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com

The current implementation causes a hard error when given an abominable
function type like 'int () const' because the non-taken branch of the
std::conditional ('typename remove_extent<_Up>::type*') attempts to form a
pointer to it:

template <class _Tp>
struct _LIBCPP_TEMPLATE_VIS decay
{
private:
    typedef typename remove_reference<_Tp>::type _Up;
public:
    typedef typename conditional
                     <
                         is_array<_Up>::value,
                         typename remove_extent<_Up>::type*,
                         typename conditional
                         <
                              is_function<_Up>::value,
                              typename add_pointer<_Up>::type,
                              typename remove_cv<_Up>::type
                         >::type
                     >::type type;
};

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to