view gcc/testsuite/g++.dg/cpp0x/conv-tmpl4.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line source

// PR c++/93870 - wrong error when converting template non-type arg.
// { dg-do compile { target c++11 } }

template <typename ENUM> struct EnumWrapper
{
	ENUM value;

	constexpr operator ENUM() const
	{
		return value;
	}
};

enum E : int { V };

constexpr EnumWrapper<E> operator ~(E a)
{
    return {E(~int(a))};
}

template <E X> struct R
{
    static void Func();
};

template <E X> struct S : R<~X>
{
};

void Test()
{
    S<E::V>::Func();
}