This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/81671] New: std::nullptr_t incompatible to std::nullptr_t
- From: "joerg dot richter at pdv-fs dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 02 Aug 2017 13:12:54 +0000
- Subject: [Bug c++/81671] New: std::nullptr_t incompatible to std::nullptr_t
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81671
Bug ID: 81671
Summary: std::nullptr_t incompatible to std::nullptr_t
Product: gcc
Version: 7.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: joerg.richter@pdv-fs.de
Target Milestone: ---
cat > t.cc << EOF
#include <cstddef>
template<class R, class CB> struct Bar
{};
template<class R> struct Bar<R, std::nullptr_t>
{
template<std::nullptr_t> struct Bind { constexpr static int const cb = 0;
};
};
int foo()
{
return Bar<int, decltype(nullptr)>::Bind<nullptr>::cb;
}
EOF
g++ t.cc
Gives this:
t.cc: In instantiation of 'struct Bar<int, std::nullptr_t>':
t.cc:10:37: required from here
t.cc:6:37: error: '<enumerator>' is not a valid template argument for type
'std::nullptr_t' because it is of type 'std::nullptr_t'
Works with 4.9.3, 5.3.0 and 6.2.0