This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/36961] New: fails to identify template


enum A{a};
enum B{b};
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>(foo);
    }

gets you:
~/ootbc/personal/ivan$ g++ foo.cc
foo.cc: In function ?int main()?:
foo.cc:31: error: expected primary-expression before ?)? token


-- 
           Summary: fails to identify template
           Product: gcc
           Version: 4.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36961


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]