This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17344] completely wacky error with matching template template classes and default arguments
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Sep 2004 16:22:24 -0000
- Subject: [Bug c++/17344] completely wacky error with matching template template classes and default arguments
- References: <20040907100712.17344.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-09-16 16:22 -------
Given my explanation, one can of course omit the friend function
injection:
--------------------
template <class> struct intTraits;
template<> struct intTraits<int> {
static const int i = 0;
};
template<typename E, E i = intTraits<E>::i> struct A {};
struct S {
template <template <typename> class X> S(X<void>);
};
int bar(S);
int bar(A<int,0>);
A<int> bed;
int i = bar(bed);
-----------------------
g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -c x.cc
x.cc:17: error: template argument 2 is invalid
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17344