Commit aede75ed by Giovanni Bajo Committed by Bernardo Innocenti

re PR c++/2094 (unimplemented: use of `ptrmem_cst' in template type unification)

        PR c++/2094
        * g++.dg/template/ptrmem7.C: New test.

From-SVN: r73578
parent 28e8f3a0
2003-11-14 Giovanni Bajo <giovannibajo@libero.it>
PR c++/2094
* g++.dg/template/ptrmem7.C: New test.
2003-11-13 Andrew Pinski <apinski@apple.com>
* gcc.c-torture/compile/20031113-1.c: New test.
......
// { dg-do compile }
// Origin: <togawa at acm dot arg>
// c++/2094: unsupported 'ptrmem_cst' in type unification
struct R
{
int i;
};
struct S
{
int i;
int j;
};
struct S2 : S
{};
template<int S::*p, typename>
struct X
{
X ();
template<typename U> X(const X<p,U> &);
};
X<&S::i,S> x = X<&S::i,S>();
X<&S::i,S> x2 = X<&S2::i,S>();
X<&S::i,S> y = X<&S::j,S>(); // { dg-error "" }
X<&S::i,S> z = X<&R::i,S>(); // { dg-error "" }
template <class T>
struct Foo
{
void foo(void)
{
X<&T::i,T> x = X<&T::i,T>();
X<&S::i,S> x2 = X<&S2::i,S>();
X<&S::i,S> y = X<&S::j,S>(); // { dg-error "" }
X<&S::i,S> z = X<&R::i,S>(); // { dg-error "" }
}
};
template struct Foo<S>; // { dg-error "instantiated from" }
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