[Bug c++/41927] New: [C++0x] Spurious warning with enable_if and efault function template argument
paolo dot carlini at oracle dot com
gcc-bugzilla@gcc.gnu.org
Tue Nov 3 17:20:00 GMT 2009
This issue is very annoying, triggers in many places in the C++0x library, is
not suppressed in system headers. Just compile the below with -std=c++0x and
-Wall. Jason, any chance you can have a look?
template<typename Tp>
struct is_int
{ static const bool value = true; };
template<bool, typename Tp = void>
struct enable_if
{ };
template<typename Tp>
struct enable_if<true, Tp>
{ typedef Tp type; };
template<typename Rep>
struct duration
{
duration() { }
template<typename Rep2, typename = typename
enable_if<false || (true && is_int<Rep2>::value)>::type>
duration(const duration<Rep2>&) { }
};
int main()
{
duration<int> d0;
duration<int> d1 = d0;
}
--
Summary: [C++0x] Spurious warning with enable_if and efault
function template argument
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: paolo dot carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41927
More information about the Gcc-bugs
mailing list