Compiling the attached preprocessed code with gcc 4.3 svn rev. 128893 (regardless of compiler flags) results in project.cpp:2826: internal compiler error: canonical types differ for identical types const QList<QStringList> and const QList<QStringList> Please submit a full bug report, See <http://gcc.gnu.org/bugs.html> for instructions. This breaks building Qt 4.x.
Created attachment 14282 [details] bzip2-ed preprocessed source
The error also occurs on powerpc64-linux with -m64, where a regression hunt identified the following patch: http://gcc.gnu.org/viewcvs?view=rev&rev=128488 r128488 | jason | 2007-09-14 06:07:25 +0000 (Fri, 14 Sep 2007)
Created attachment 14373 [details] smaller testcase, thanks to delta
This is the shortest I can come up with: ---------------------- template <typename T> struct __attribute__((visibility("default"))) List {}; int bar(List<int> args); bool test(const List<int> &); int i = bar(List<int>()); bool test(const List<int> &) {} --------------------- tmp/bangerth> /tmp/bangerth/bin/gcc-mainline/bin/c++ -c x.cc x.cc: In function 'bool test(const List<int>&)': x.cc:9: internal compiler error: canonical types differ for identical types const List<int> and const List<int> Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. W.
Subject: Bug 33620 Author: jason Date: Mon Oct 22 18:03:10 2007 New Revision: 129553 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129553 Log: PR c++/33620 * class.c (finish_struct_bits): Copy TYPE_ATTRIBUTES. * pt.c (apply_late_template_attributes): Splice out dependent attributes from DECL_ATTRIBUTES. * decl.c (cxx_maybe_build_cleanup): Use build_address. Added: trunk/gcc/testsuite/g++.dg/ext/tmplattr7.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/class.c trunk/gcc/cp/decl.c trunk/gcc/cp/pt.c
Fixed.
*** Bug 33865 has been marked as a duplicate of this bug. ***
Created attachment 15075 [details] Another variant of the bug Another internal compiler error with a similar symptoms. f.c:11: internal compiler error: canonical types differ for identical types const NGram<I> and const NGram<I>
Comment on attachment 15075 [details] Another variant of the bug class Header {}; template <int I> class NGram { public: Header GetHeader() const; } __attribute__((__packed__)); template <int I> Header NGram<I>::GetHeader() const { return 0; }
Sharad, what compiler version did you use for the new testcases?
This latest problem is identical to PR c++/35074, which has now been fixed. The new test case in this bug is passing.