c++/10514: incorrect parsing of template instatiation with pointer-to-member variables

reichelt@igpm.rwth-aachen.de reichelt@igpm.rwth-aachen.de
Mon Apr 28 13:56:00 GMT 2003


Synopsis: incorrect parsing of template instatiation with pointer-to-member variables

State-Changed-From-To: open->analyzed
State-Changed-By: reichelt
State-Changed-When: Mon Apr 28 13:56:14 2003
State-Changed-Why:
    Confirmed.
    The parser hickups affect all release versions since 2.95.x,
    as well as 3.3 branch and mainline.
    
    BTW, not only using
      i_1->A::TFUNC_A<w_a,w_b>( m_b1 );
    but also writing
      i_1->template TFUNC_A<w_a,w_b>( m_b1 );
    makes the code compile.
    
    The problem can also be demonstrated with the following code snippet:
    
    ============================snip here===============================
    struct A
    {
        template <int> void foo() {}
    };
    
    struct B
    {
        template <int> void bar (A* p)
        {
            p->foo<0>(); // compiler trouble
        }
    
        void baz (A* p)
        {
            bar<0>(p);
        }
    };
    ============================snip here===============================
    
    Regards,
    Volker

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10514



More information about the Gcc-prs mailing list