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++/12932] New: segfault compiling tempalte instantiation


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: segfault  compiling tempalte instantiation
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cxl at ntllib dot org
                CC: gcc-bugs at gcc dot gnu dot org

class EmptyClass {};

template <class T, int (*compare)(T a, T b), class B = EmptyClass>
class CompareRelOps : B
{
public:
	friend bool operator <  (T a, T b)  { return (*compare)(a, b) <  0; }
};

struct Test
{
	static int compare(const Test& a, const Test& b);
};

template class CompareRelOps<const Test&, Test::compare>;

int main()
{
	Test a, b;
	a < b;
	return 0;
}
 
------
GCC version: gcc (GCC) 3.4 20031006 (experimental)
build MingW

command-line
c++ -c -ggdb -g2 -D_DEBUG -O0 -x c++ -I"f:/uppdev" -I"f:/uppsrc"
-I"G:/mingw2/i386-mingw32/include" -I"f:/uppsrc" -I"f:/uppsrc/platform" -I"e:/v/in
	clude" -I"d:/ORANT/OCI80/INCLUDE" -I"d:/mysql/include" -DflagCONSOLE -DflagST
-DflagSTATIC -DflagMAIN -DflagWIN32 -DflagGNU -DflagIA32 -DflagDE
	BUG   f:/uppdev/TestGCC/main.cpp -o 

output:

e:/out/upp/TestGCC/CONSOLE-DEBUG-GNU-IA32-MAIN-ST-STATIC-WIN32/main.o
f:/uppdev/TestGCC/main.cpp: In function `bool operator<(const Test&, const Test&)':
f:/uppdev/TestGCC/main.cpp:35:   instantiated from here
f:/uppdev/TestGCC/main.cpp:17: internal compiler error: Segmentation fault


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