This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60852] boost::has_complement of enum class does not compile
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Apr 2014 20:24:08 +0000
- Subject: [Bug c++/60852] boost::has_complement of enum class does not compile
- Auto-submitted: auto-generated
- References: <bug-60852-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60852
Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |trippels at gcc dot gnu.org
--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
reduced test case:
struct A;
typedef A false_;
struct A
{
};
template <int> struct B;
template <> struct B<false> : false_
{
};
template <int> struct C
{
static const int value = 0;
};
template <typename T> T &make ();
struct D
{
template <class T> D (T);
};
template <typename, typename, int> struct G;
template <typename Rhs> struct H
{
static const int value = G<Rhs, int, 0>::value;
};
template <typename Rhs> struct I : B<H<Rhs>::value>
{
};
enum class E;
int operator~(const D &);
template <typename Rhs> struct F
{
static const int value = sizeof ~make<Rhs>();
};
template <typename Rhs, typename Ret> struct G<Rhs, Ret, 0>
{
static const int value = C<F<Rhs>::value>::value;
};
int main () { I<E>(); }
markus@x4 tmp % g++ -std=c++11 boost.ii
boost.ii: In instantiation of âconst int F<E>::valueâ:
boost.ii:35:20: required from âconst int G<E, int, 0>::valueâ
boost.ii:22:20: required from âconst int H<E>::valueâ
boost.ii:24:32: required from âstruct I<E>â
boost.ii:37:20: required from here
boost.ii:31:35: error: no match for âoperator~â (operand type is âEâ)
static const int value = sizeof ~make<Rhs>();
^