re PR c++/66427 (The compiler rejects too complex variable templates)

2015-08-04  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/66427
	* g++.dg/cpp1y/var-templ34.C: New.

From-SVN: r226568
This commit is contained in:
Paolo Carlini 2015-08-04 11:05:02 +00:00 committed by Paolo Carlini
parent 91d0e8dec9
commit 01003b8381
2 changed files with 25 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2015-08-04 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/66427
* g++.dg/cpp1y/var-templ34.C: New.
2015-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com> 2015-08-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/aarch64/pragma_cpp_predefs_1.c: New test. * gcc.target/aarch64/pragma_cpp_predefs_1.c: New test.

View File

@ -0,0 +1,20 @@
// PR c++/66427
// { dg-do compile { target c++14 } }
template<typename T>
struct complex {};
struct plus {};
struct multiplies {};
template<typename T, typename Op>
constexpr T identity_element;
template<>
constexpr int identity_element<int, plus> = 0;
template<typename T>
constexpr complex<T> identity_element<complex<T>, plus> = {
identity_element<T, plus>,
identity_element<T, plus>
};