This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36961] fails to identify template
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jul 2008 00:52:28 -0000
- Subject: [Bug c++/36961] fails to identify template
- References: <bug-36961-6594@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from igodard at pacbell dot net 2008-07-29 00:52 -------
Oops - sorry, posted wrong test case:
enum A{a};
enum B{b};
enum C{c};
enum D{d};
class bottom {};
template<typename E> class attr {
public: E v;
operator E() { return v;}
};
template<template<typename> class node, typename attr, typename next>
class attrNode : public node<attr>, public next {};
template<template<typename> class node>
class list1 : public
attrNode<node, A,
attrNode<node, B,
bottom > > {};
class foo : public list1<attr> {};
list1<attr> v1;
foo v2;
template<typename E, template<typename>class node,
template<template<typename> class> class nodeList >
node<E>& att(nodeList<node>& v) { return v; }
int main() {
A x1 = att<A>(v1);
B x2 = att<B>(v1);
A x3 = att<A>(v2);
}
gets you:
~/ootbc/personal/ivan$ g++ foo.cc
foo.cc: In function ?int main()?:
foo.cc:33: error: no matching function for call to ?att(foo&)?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36961