Summary: | [3.3 regression] Segfault on illegal use of template without template args | ||
---|---|---|---|
Product: | gcc | Reporter: | smueller |
Component: | c++ | Assignee: | Mark Mitchell <mmitchel> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs |
Priority: | P3 | Keywords: | ice-on-invalid-code, monitored |
Version: | 3.2 | ||
Target Milestone: | 3.3.1 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2003-06-30 22:26:13 |
Description
smueller
2003-04-30 00:46:01 UTC
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed. Though the error happens even earlier (in a tree check function) if checking is enabled. Here's a smaller testcase: -------------------------- namespace NS { template <typename> struct C { template <typename U> C (U); }; struct X { X(C<int>); }; } NS::X x(NS::C); -------------------------- It crashes 3.3 as follows: g/x> /home/bangerth/bin/gcc-3.3-pre/bin/c++ -c x.cc x.cc:11: internal compiler error: Segmentation fault Please submit a full bug report, 3.4 gives a useful error message on this as well as the original testcase. 2.95 crashes on this one, but it doesn't crash on the original testcase, so this is a 3.3 (not 3.4) regression. W. To justify the stamp "regression", here's a testcase that crashes gcc 3.0 - 3.3, but not gcc 2.95.x and mainline: -------------------------------------------------------------------- namespace N { template <typename> struct A { template <typename T> A(A<T>); }; } void foo(N::A<int>); void bar() { foo(N::A); } -------------------------------------------------------------------- Moving target back to 3.3.1. Subject: Bug 10558 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: mmitchel@gcc.gnu.org 2003-07-11 08:39:58 Modified files: gcc/cp : ChangeLog parse.y gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/parse: template8.C Log message: PR c++/10558 * parse.y (class_template_ok_as_expr): New variable. (template_arg_1): New non-terminal. (primary): Issue errors about uses of class templates as expressions. PR c++/10558 * g++.dg/parse/template8.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.178&r2=1.3076.2.179 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parse.y.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.284.2.7&r2=1.284.2.8 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.225&r2=1.2261.2.226 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/template8.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1 Subject: Bug 10558 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2003-07-11 08:41:44 Modified files: gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/parse: template8.C Log message: PR c++/10558 * g++.dg/parse/template8.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2865&r2=1.2866 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/template8.C.diff?cvsroot=gcc&r1=1.1&r2=1.2 Fixed in GCC 3.3.1. Subject: Bug 10558 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2003-07-11 08:53:59 Modified files: gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: nontype2.C Log message: PR c++/8164 * decl.c (duplicate_decls): Avoid mangling names unnecessarily. PR c++/8164 * g++.dg/template/nontype2.C: New test. PR c++/10558 * g++.dg/parse/template8.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2866&r2=1.2867 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/nontype2.C.diff?cvsroot=gcc&r1=1.1&r2=1.2 |