Commit 59e01f36 by Marek Polacek Committed by Marek Polacek

re PR c++/56428 ([C++11] "is not a constant expression" when comparing non-type…

re PR c++/56428 ([C++11] "is not a constant expression" when comparing non-type template argument to nullptr)

	PR c++/56428
	* g++.dg/cpp0x/nontype4.C: New test.

From-SVN: r274028
parent 8a2e0013
2019-08-02 Marek Polacek <polacek@redhat.com>
PR c++/56428
* g++.dg/cpp0x/nontype4.C: New test.
2019-08-02 Marek Polacek <polacek@redhat.com>
PR c++/53009
* g++.dg/cpp0x/nontype3.C: New test.
......
// PR c++/56428
// { dg-do compile { target c++11 } }
struct A { };
template<bool B>
struct Builder
{
static A build() { return A(); }
};
template<A (*F)()>
A f()
{
return Builder<F != nullptr>::build();
}
A g();
int main()
{
f< &g >();
f< nullptr >();
f< &f<nullptr> >();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment