[Bug 541425]
(In reply to comment #13) > Once you know A's T, you have a desired type int (*)(T, T) from which to > determine which specialization of the template to use. Hm, I agree that the type could be deduced. I could nevertheless have sworn that this should be invalid: .. template int cmp1(T a, T b); int (*cmp)(int, int) = cmp1; ... But it compiles in fact. I had no idea a template name could be implicitly instantiated in this context. Thanks for educating me! Best W. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/541425 Title: [PR44629] internal compiler error in unify -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425]
(In reply to comment #12) > I'm confused why this would be an overload set. cmp1 is a template so I > can't see how this code would even begin to be valid without specifying > the template argument in the default argument... Once you know A's T, you have a desired type int (*)(T, T) from which to determine which specialization of the template to use. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/541425 Title: [PR44629] internal compiler error in unify -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425]
(In reply to comment #4) > template int cmp1(T a, T b); > template int cmp2(T a, T b); > template struct A { }; I'm confused why this would be an overload set. cmp1 is a template so I can't see how this code would even begin to be valid without specifying the template argument in the default argument... W. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/541425 Title: [PR44629] internal compiler error in unify -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425]
ICE fixed in 4.4, 4.5, 4.6. Not worth applying to 4.3 at this point I think. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/541425 Title: [PR44629] internal compiler error in unify -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425]
Author: jason Date: Wed Mar 9 17:57:51 2011 New Revision: 170826 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170826 Log: PR c++/44629 * pt.c (unify): An unresolved overload is a nondeduced context. Added: branches/gcc-4_5-branch/gcc/testsuite/g++.dg/template/nontype22.C Modified: branches/gcc-4_5-branch/gcc/cp/ChangeLog branches/gcc-4_5-branch/gcc/cp/pt.c branches/gcc-4_5-branch/gcc/testsuite/ChangeLog -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/541425 Title: [PR44629] internal compiler error in unify -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425]
Author: jason Date: Wed Mar 9 17:57:48 2011 New Revision: 170825 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170825 Log: PR c++/44629 * pt.c (unify): An unresolved overload is a nondeduced context. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/nontype22.C Modified: branches/gcc-4_4-branch/gcc/cp/ChangeLog branches/gcc-4_4-branch/gcc/cp/pt.c branches/gcc-4_4-branch/gcc/testsuite/ChangeLog -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/541425 Title: [PR44629] internal compiler error in unify -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425]
Author: jason Date: Wed Mar 9 17:57:46 2011 New Revision: 170824 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=170824 Log: PR c++/44629 * pt.c (unify): An unresolved overload is a nondeduced context. Added: trunk/gcc/testsuite/g++.dg/template/nontype22.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/541425 Title: [PR44629] internal compiler error in unify -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425]
A middle ground would be to fix the bug in unify without adding mangling support, so we get the sorry there. I guess I'll do that. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/541425 Title: [PR44629] internal compiler error in unify -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425] Re: [PR44629] internal compiler error in unify
** Changed in: gcc Status: Confirmed => Fix Released -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/541425 Title: [PR44629] internal compiler error in unify -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425] Re: [PR44629] internal compiler error in unify
Launchpad has imported 7 comments from the remote bug at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44629. If you reply to an imported comment from within Launchpad, your comment will be sent to the remote bug automatically. Read more about Launchpad's inter-bugtracker facilities at https://help.launchpad.net/InterBugTracking. On 2010-06-22T09:56:54+00:00 Matthias Klose wrote: seen with 4.3, 4.4, 4.5, 4.6 $ gcc-4.5 -c aclib.ii ../aclib/aclib.cpp: In function 'void ac_print_dot(acSearcher*)': ../aclib/aclib.cpp:35:61: internal compiler error: in unify, at cp/pt.c:15155 Please submit a full bug report, with preprocessed source if appropriate. Reply at: https://bugs.launchpad.net/gcc/+bug/541425/comments/3 On 2010-06-22T09:57:48+00:00 Matthias Klose wrote: Created attachment 20976 preprocessed source Reply at: https://bugs.launchpad.net/gcc/+bug/541425/comments/4 On 2010-06-22T11:04:53+00:00 Rguenth wrote: Confirmed. ../aclib/aclib.cpp(35): error: no instance of function template "ACSearch::Grapher::simple_output" matches the argument list argument types are: (acSearcher) std::basic_string output = Grapher::simple_output(*s); ^ Reduced testcase for the ICE: template struct char_traits; namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { template class new_allocator { }; } namespace std __attribute__ ((__visibility__ ("default"))) { template class allocator: public __gnu_cxx::new_allocator<_Tp> { }; template, typename _Alloc = allocator<_CharT> > class basic_string; template class basic_string { }; } template int eq_cmp(T a, T b){ } template int unsafe_case_cmp(T a, T b){ } template class Searcher{ }; class Grapher{ template static std::basic_string simple_output(Searcher &sch){ } }; typedef Searcher acSearcher; void ac_print_dot(acSearcher *s){ std::basic_string output = Grapher::simple_output(*s); } Reply at: https://bugs.launchpad.net/gcc/+bug/541425/comments/6 On 2010-06-22T16:46:02+00:00 Jakub-gcc wrote: 3.4 gives here: pr44629.C:23: sorry, unimplemented: use of `overload' in template type unification pr44629.C:23: error: no matching function for call to `Grapher::simple_output(Searcher&)' int unsafe_case_cmp(T, T) [with T = char] So it is a regression. Reply at: https://bugs.launchpad.net/gcc/+bug/541425/comments/7 On 2011-03-04T00:54:56+00:00 Jason-gcc wrote: Same ICE on valid testcase: template int cmp1(T a, T b); template int cmp2(T a, T b); template struct A { }; template void f (A &); void g() { A a; f(a); } though 3.4 didn't accept it, it gave the same sorry, so it isn't a big regression. Reply at: https://bugs.launchpad.net/gcc/+bug/541425/comments/8 On 2011-03-04T22:24:30+00:00 Jason-gcc wrote: Created attachment 23550 WIP patch to accept my testcase Here's a patch that makes my testcase work. I don't want to put it in 4.6 because it produces mangling different from the EDG compiler, and want to clarify how it should mangle first. Reply at: https://bugs.launchpad.net/gcc/+bug/541425/comments/9 On 2011-03-04T22:30:16+00:00 Jason-gcc wrote: Created attachment 23551 WIP patch to make the testcase sorry as before And here's a patch that just restores the previous sorry behavior. Do you think it's worth applying this to 4.6? Reply at: https://bugs.launchpad.net/gcc/+bug/541425/comments/10 ** Changed in: gcc Importance: Unknown => Medium -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/541425 Title: [PR44629] internal compiler error in unify -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425] Re: [PR44629] internal compiler error in unify
** Changed in: gcc Status: New => Confirmed -- [PR44629] internal compiler error in unify https://bugs.launchpad.net/bugs/541425 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425] Re: [PR44629] internal compiler error in unify
** Changed in: gcc Status: Unknown => New -- [PR44629] internal compiler error in unify https://bugs.launchpad.net/bugs/541425 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425] Re: internal compiler error in unify
seen with 4.4 and 4.5 too ** Bug watch added: GCC Bugzilla #44629 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44629 ** Also affects: gcc via http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44629 Importance: Unknown Status: Unknown ** Changed in: gcc-4.3 (Ubuntu) Importance: Undecided => Low ** Changed in: gcc-4.3 (Ubuntu) Status: New => Confirmed ** Summary changed: - internal compiler error in unify + [PR44629] internal compiler error in unify -- [PR44629] internal compiler error in unify https://bugs.launchpad.net/bugs/541425 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425] Re: internal compiler error in unify
Also happens on gcc-snapshot Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 20090327-0ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-snapshot/README.Bugs --enable-languages=c,c++,java,fortran,objc,obj-c++,ada --prefix=/usr/lib/gcc-snapshot --enable-shared --enable-multiarch --with-system-zlib --disable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-java-awt=gtk --enable-gtk-cairo --disable-plugin --with-java-home=/usr/lib/gcc-snapshot/java-1.5.0-gcj-4.4-1.5.0.0/jre --enable-java-home --with-jvm-root-dir=/usr/lib/gcc-snapshot/jvm --with-jvm-jar-dir=/usr/lib/gcc-snapshot/jvm-exports --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-mpfr --enable-targets=all --disable-werror --with-tune=generic --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.4.0 20090327 (experimental) [trunk revision 145121] (Ubuntu 20090327-0ubuntu1) sst...@sphinx:~/src/acSearch/aclibtest$ g++ aclib.i ../aclib/aclib.cpp: In function 'void ac_print_dot(acSearcher*)': ../aclib/aclib.cpp:35: internal compiler error: in unify, at cp/pt.c:13924 Please submit a full bug report, -- internal compiler error in unify https://bugs.launchpad.net/bugs/541425 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425] [NEW] internal compiler error in unify
Public bug reported: Binary package hint: gcc-4.3 Trying to compile the attached, preprocessed, source gives the error: ../aclib/aclib.cpp: In function ‘void ac_print_dot(acSearcher*)’: ../aclib/aclib.cpp:35: internal compiler error: in unify, at cp/pt.c:13439 Please submit a full bug report, with preprocessed source if appropriate. See for instructions. GCC version: Using built-in specs. Target: i486-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.3-5ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-targets=all --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu Thread model: posix gcc version 4.3.3 (Ubuntu 4.3.3-5ubuntu4) on Ubuntu 9.04 ** Affects: gcc-4.3 (Ubuntu) Importance: Undecided Status: New -- internal compiler error in unify https://bugs.launchpad.net/bugs/541425 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs
[Bug 541425] Re: internal compiler error in unify
** Attachment added: "aclib.i" http://launchpadlibrarian.net/41243045/aclib.i -- internal compiler error in unify https://bugs.launchpad.net/bugs/541425 You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs