[LLVMbugs] [Bug 20002] New: Cannot derive from std::function
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed Jun 11 01:58:49 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=20002
Bug ID: 20002
Summary: Cannot derive from std::function
Product: libc++
Version: 3.4
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: david_work at me.com
CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
Classification: Unclassified
#include <functional>
struct s : std::function< void() > {
using function::function;
};
s q( std::function< void() >( []{} ) );
Nothing says std::function can't or shouldn't be used as a base class. However,
this simple test yields an error,
c++/v1/functional:1454:41: error: no type named 'type' in
'std::__1::enable_if<false, void>'; 'enable_if' cannot be used to disable this
declaration
I'm not sure why SFINAE isn't allowed in that context, but it might be because
of the phrasing of 12.9/1.2:
— for each non-template constructor of X that has at least one parameter with a
default argument, the set of constructors that results from omitting any
ellipsis parameter specification and successively omitting parameters with a
default argument from the end of the parameter-type-list
Omitting the default argument strips SFINAE from the constructor. The fix is to
move the SFINAE condition to the exception specification.
--
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/20140611/ba54ec07/attachment.html>
More information about the llvm-bugs
mailing list