public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29080]  New: Multiple-inheritance code triggers "internal compiler error: in build_base_path, at cp/class.c:273"
@ 2006-09-14 10:28 raymond at corvil dot com
  2006-09-14 15:33 ` [Bug c++/29080] [4.0/4.1/4.2 Regression] Multiple-inheritance with template method function " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: raymond at corvil dot com @ 2006-09-14 10:28 UTC (permalink / raw)
  To: gcc-bugs

Compiling a .cpp file with the following contents triggers an internal compiler
error:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

struct Base {
        template<class C> void  method() { }
};

struct Left     : public Base { };
struct Right    : public Base { };
struct Join     : public Left, public Right { };

void    function()
{
        Join join;
        join.Base::method<int>();
        join.Left::method<int>();
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


Issued command-line:
    g++ -Wall -W -Wundef -Wpointer-arith -g -O0 -c -o /dev/null bug.cpp

Resulting output:
    bug.cpp: In function 'void function()':
    bug.cpp:13: internal compiler error: in build_base_path, at cp/class.c:273
    Please submit a full bug report,
    ...

The error does not occur if structs Left and Right inherit virtually from Base;
 that is, "struct Left : virtual public Base { };" and similarly for Right. 
The same error occurs with gcc-3.4.3, the only difference being that the
relevant line number in cp/class.cp is 275.

Full output from running with "-v --save-temps" is as follows:
    g++ -v -save-temps -Wall -W -Wundef -Wpointer-arith -g -O0 -c -o /dev/null
bug.cpp
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.1.1/configure --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++
Thread model: posix
gcc version 4.1.1
 /usr/local/libexec/gcc/i686-pc-linux-gnu/4.1.1/cc1plus -E -quiet -v
-D_GNU_SOURCE bug.cpp -mtune=pentiumpro -Wall -W -Wundef -Wpointer-arith
-fworking-directory -O0 -fpch-preprocess -o bug.ii
ignoring nonexistent directory "NONE/include"
ignoring nonexistent directory
"/usr/local/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1

/usr/local/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/i686-pc-linux-gnu

/usr/local/lib/gcc/i686-pc-linux-gnu/4.1.1/../../../../include/c++/4.1.1/backward
 /usr/local/include
 /usr/local/lib/gcc/i686-pc-linux-gnu/4.1.1/include
 /usr/include
End of search list.
 /usr/local/libexec/gcc/i686-pc-linux-gnu/4.1.1/cc1plus -fpreprocessed bug.ii
-quiet -dumpbase bug.cpp -mtune=pentiumpro -auxbase-strip /dev/null -g -O0
-Wall -W -Wundef -Wpointer-arith -version -o bug.s
GNU C++ version 4.1.1 (i686-pc-linux-gnu)
        compiled by GNU C version 4.1.1.
GGC heuristics: --param ggc-min-expand=63 --param ggc-min-heapsize=63424
Compiler executable checksum: 5c1ee95ea2451a4e1aafd30c10a207cb
bug.cpp: In function 'void function()':
bug.cpp:13: internal compiler error: in build_base_path, at cp/class.c:273
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


Contents of bug.ii:
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
# 1 "bug.cpp"
# 1 "/home/raymond/tmp//"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "bug.cpp"

struct Base {
 template<class C> void method() { }
};

struct Left : public Base { };
struct Right : public Base { };
struct Join : public Left, public Right { };

void function()
{
 Join join;
 join.Base::method<int>();
 join.Left::method<int>();
}
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


-- 
           Summary: Multiple-inheritance code triggers "internal compiler
                    error: in build_base_path, at cp/class.c:273"
           Product: gcc
           Version: 4.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: raymond at corvil dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-02-03 20:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-14 10:28 [Bug c++/29080] New: Multiple-inheritance code triggers "internal compiler error: in build_base_path, at cp/class.c:273" raymond at corvil dot com
2006-09-14 15:33 ` [Bug c++/29080] [4.0/4.1/4.2 Regression] Multiple-inheritance with template method function " pinskia at gcc dot gnu dot org
2006-09-14 15:58 ` raymond at corvil dot com
2006-09-15 13:50 ` bangerth at dealii dot org
2006-09-20 22:36 ` mmitchel at gcc dot gnu dot org
2006-09-23 15:19 ` steven at gcc dot gnu dot org
2006-10-02  4:09 ` mmitchel at gcc dot gnu dot org
2006-10-02  4:12 ` mmitchel at gcc dot gnu dot org
2006-10-02  4:51 ` [Bug c++/29080] [4.0/4.1 " mmitchel at gcc dot gnu dot org
2006-10-02  4:52 ` [Bug c++/29080] [4.0 " mmitchel at gcc dot gnu dot org
2007-02-03 20:15 ` gdr at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).