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++/13642] New: Segmentation fault when calling a function template in a function template


The following code produces a segmentation fault:

class A{
public:
        template<typename T> T *f3();
};
A *a;

template<class T2>
void f2(){
        a->f3<T2>();
}
void f1(){
        f2<int>();
}

worth mentioning:
 - if 'a' isn´t a pointer but an instance of A calling a.f3<T2>() works.
 - direct call of f3 in f1 works
 - there is another similar case which doesn´t produce a segmentation fault but
a parse error at '>' in f2. however, this is in a file > 1000 lines with
multiple headers, and I couldn´t reproduce it in a small code snippet.


Thank you,

Stefan.

-- 
           Summary: Segmentation fault when calling a function template in a
                    function template
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: sengir at gmx dot net
                CC: gcc-bugs at gcc dot gnu dot org


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


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