c++/4249: Trouble with static templated member functions

reichelt@igpm.rwth-aachen.de reichelt@igpm.rwth-aachen.de
Thu Sep 6 08:56:00 GMT 2001


>Number:         4249
>Category:       c++
>Synopsis:       Trouble with static templated member functions
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          ice-on-legal-code
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 06 08:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Volker Reichelt
>Release:        gcc 3.0.2 (prerelease snapshot 20010903), gcc 3.0.1, gcc 2.95.3
>Organization:
>Environment:
mips-sgi-irix6.5, i686-pc-linux-gnu
>Description:
The following (legal) code snippet crashes various versions
of g++:

struct A
{
    void f();
    template <class T> static void g();
};

struct B {};

void h( void (*)() );

void A::f()
{
    h(&g<void>);
}

with the following error message:

Bug.cpp: In member function `void A::f()':
Bug.cpp:13: Internal compiler error in c_expand_expr, at c-common.c:4121
Please submit a full bug report, [...]
>How-To-Repeat:
g++ -c Bug.cpp
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list