Commit e1a96a57 by Alexandre Oliva Committed by Alexandre Oliva

sizeof2.C: incorrect specialization of base template is selected

	* g++.old-deja/g++.pt/sizeof2.C: incorrect specialization of base
	template is selected

From-SVN: r23468
parent 7e0a7fc2
1998-10-31 Alexandre Oliva <oliva@dcc.unicamp.br>
* g++.old-deja/g++.pt/sizeof2.C: incorrect specialization of base
template is selected
* g++.old-deja/g++.ext/arrnew2.C: if new T[n](i) is accepted for
classes, it should be accepted for all types.
......
// Although template class B is not used at all, it causes the
// incorrect specialization of A to be selected
// Adapted from testcase by Oskar Enoksson <osken393@student.liu.se>
// execution test - XFAIL *-*-*
extern "C" void abort();
template<int N, class T> // Base class
class A { public: static int n() { return sizeof(T); } };
template<int N> // Derived #1
class B: public A<N,char[N]> {};
template<int N, int M> // Derived #2 (wrong!)
class C: public A<N,char[M]> {};
int main() {
if (C<1,2>::n() != 2)
abort();
}
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