public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18429] New: ICE for g++-3.3.5/ endless loop for g++-3.4.3 (template and namespace)
@ 2004-11-11 16:21 andre dot maute at gmx dot de
  2004-11-11 16:51 ` [Bug c++/18429] [4.0 Regression] ICE on invalid code with array size being a non constant variable pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: andre dot maute at gmx dot de @ 2004-11-11 16:21 UTC (permalink / raw)
  To: gcc-bugs

the following code ICEs with g++-3.3.5 and freezes g++-3.4.3 
 
--- begin of tree.cc -------------------------------------- 
namespace numbers { 
int subtrees = 4; 
} 
 
template< class T > 
class Tree { 
public: 
        Tree* L[numbers::subtrees]; 
        Tree* R[numbers::subtrees]; 
public: 
        Tree() { 
                L[0] = 0; 
                R[0] = 0; 
        } 
        ~Tree() { 
                if( L[0] ) 
                        delete [] L[0]; 
                if( R[0] ) 
                        delete [] R[0]; 
        } 
}; 
 
 
int main() { 
        Tree<int> t; 
        return 0; 
} 
--- end of tree.cc -------------------------------- 
 
> g++-3.3.5 -v 
Reading specs from /opt/gcc-3.3.5/lib/gcc-lib/i686-pc-linux-gnu/3.3.5/specs 
Configured with: ../gcc-3.3.5/configure --prefix=/opt/gcc-3.3.5 
--enable-shared--enable-languages=c,c++ --enable-threads=posix 
--enable-__cxa_atexit --enable-clocale=gnu --program-suffix=-3.3.5 
--with-cpu=pentium3 
Thread model: posix 
gcc version 3.3.5 
 
> g++-3.4.3 -v 
Reading specs from /opt/gcc-3.4.3/lib/gcc/i686-pc-linux-gnu/3.4.3/specs 
Configured with: ../gcc-3.4.3/configure --prefix=/opt/gcc-3.4.3 
--enable-shared--enable-languages=c,c++ --enable-threads=posix 
--enable-__cxa_atexit --enable-clocale=gnu --program-suffix=-3.4.3 
--with-arch=pentium3 
Thread model: posix 
gcc version 3.4.3

-- 
           Summary: ICE for g++-3.3.5/ endless loop for g++-3.4.3 (template
                    and namespace)
           Product: gcc
           Version: 3.3.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andre dot maute at gmx dot de
                CC: gcc-bugs at gcc dot gnu dot org
 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=18429


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

* [Bug c++/18429] [4.0 Regression] ICE on invalid code with array size being a non constant variable
  2004-11-11 16:21 [Bug c++/18429] New: ICE for g++-3.3.5/ endless loop for g++-3.4.3 (template and namespace) andre dot maute at gmx dot de
@ 2004-11-11 16:51 ` pinskia at gcc dot gnu dot org
  2004-11-12 19:29 ` mmitchel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-11 16:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-11 16:51 -------
: Search converges between 2004-07-29-trunk (#498) and 2004-07-30-trunk (#499).
Reduced testcase every where:
int subtrees = 4;
template< class T >
struct Tree {
  Tree* L[subtrees];
  Tree* R[subtrees];
  ~Tree()
  {
    delete [] L[0];
    delete [] R[0];
  }
};

void f()
{
        Tree<int> t;
}


Note the following is a 4.0 regression though:
int subtrees = 4;
template< class T >
struct Tree {
        Tree* L[subtrees];
        Tree() { }
};
void f()
{
        Tree<int> t;
}


Also this is invalid code as int *L[variable]; should have been rejected as variable is not constant, note 
(at least on the mainline) we reject it for non templates. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|0000-00-00 00:00:00         |2004-11-11 16:51:44
               date|                            |
            Summary|ICE for g++-3.3.5/ endless  |[4.0 Regression] ICE on
                   |loop for g++-3.4.3 (template|invalid code with array size
                   |and namespace)              |being a non constant
                   |                            |variable
   Target Milestone|---                         |4.0.0


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


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

* [Bug c++/18429] [4.0 Regression] ICE on invalid code with array size being a non constant variable
  2004-11-11 16:21 [Bug c++/18429] New: ICE for g++-3.3.5/ endless loop for g++-3.4.3 (template and namespace) andre dot maute at gmx dot de
  2004-11-11 16:51 ` [Bug c++/18429] [4.0 Regression] ICE on invalid code with array size being a non constant variable pinskia at gcc dot gnu dot org
@ 2004-11-12 19:29 ` mmitchel at gcc dot gnu dot org
  2004-11-12 21:47 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-12 19:29 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |mark at codesourcery dot com
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/18429] [4.0 Regression] ICE on invalid code with array size being a non constant variable
  2004-11-11 16:21 [Bug c++/18429] New: ICE for g++-3.3.5/ endless loop for g++-3.4.3 (template and namespace) andre dot maute at gmx dot de
  2004-11-11 16:51 ` [Bug c++/18429] [4.0 Regression] ICE on invalid code with array size being a non constant variable pinskia at gcc dot gnu dot org
  2004-11-12 19:29 ` mmitchel at gcc dot gnu dot org
@ 2004-11-12 21:47 ` cvs-commit at gcc dot gnu dot org
  2004-11-12 21:58 ` mmitchel at gcc dot gnu dot org
  2004-11-13 13:08 ` reichelt at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-11-12 21:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-11-12 21:47 -------
Subject: Bug 18429

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-11-12 21:47:13

Modified files:
	gcc/cp         : ChangeLog decl.c decl2.c parser.c pt.c tree.c 
	gcc/testsuite  : ChangeLog 
	gcc/testsuite/g++.dg/ext: vla1.C vlm1.C 
	gcc/testsuite/g++.dg/template: crash2.C 
Added files:
	gcc/testsuite/g++.dg/parse: cond1.C 
	gcc/testsuite/g++.dg/template: array9.C call3.C ptrmem11.C 

Log message:
	PR c++/18389
	* decl.c (start_decl): Make sure to set *pop_scope_p.  Return
	error_mark_node to indicate errors.
	
	PR c++/18429
	* parser.c (cp_parser_direct_declarator): Disallow non-constant
	array bounds when not inside a function.
	
	PR c++/18436
	* pt.c (tsubst_copy_and_build): Do not do Koenig lookup when an
	unqualified name resolves to a member function.
	
	PR c++/18407
	* pt.c (tsubst_copy_and_build): Handle qualified names used from a
	derived class correctly.
	
	* decl2.c (import_export_decl): Fix typo in comment.
	* tree.c (pod_type_p): Likewise.
	
	PR c++/18389
	* g++.dg/parse/cond1.C: New test.
	
	PR c++/18429
	* g++.dg/template/array9.C: New test.
	* g++.dg/ext/vla1.C: Adjust error messages.
	* g++.dg/ext/vlm1.C: Likewise.
	* g++.dg/template/crash2.C: Likewise.
	
	PR c++/18436
	* g++.dg/template/call3.C: New test.
	
	PR c++/18407
	* g++.dg/template/ptrmem11.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4480&r2=1.4481
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1326&r2=1.1327
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.756&r2=1.757
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.278&r2=1.279
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.944&r2=1.945
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/tree.c.diff?cvsroot=gcc&r1=1.418&r2=1.419
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4588&r2=1.4589
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/vla1.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/vlm1.C.diff?cvsroot=gcc&r1=1.2&r2=1.3
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/cond1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/array9.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/call3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/ptrmem11.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash2.C.diff?cvsroot=gcc&r1=1.2&r2=1.3



-- 


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


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

* [Bug c++/18429] [4.0 Regression] ICE on invalid code with array size being a non constant variable
  2004-11-11 16:21 [Bug c++/18429] New: ICE for g++-3.3.5/ endless loop for g++-3.4.3 (template and namespace) andre dot maute at gmx dot de
                   ` (2 preceding siblings ...)
  2004-11-12 21:47 ` cvs-commit at gcc dot gnu dot org
@ 2004-11-12 21:58 ` mmitchel at gcc dot gnu dot org
  2004-11-13 13:08 ` reichelt at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-11-12 21:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-11-12 21:58 -------
Fixed in GCC 4.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

* [Bug c++/18429] [4.0 Regression] ICE on invalid code with array size being a non constant variable
  2004-11-11 16:21 [Bug c++/18429] New: ICE for g++-3.3.5/ endless loop for g++-3.4.3 (template and namespace) andre dot maute at gmx dot de
                   ` (3 preceding siblings ...)
  2004-11-12 21:58 ` mmitchel at gcc dot gnu dot org
@ 2004-11-13 13:08 ` reichelt at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-11-13 13:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-11-13 13:08 -------
*** Bug 12807 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org


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


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

end of thread, other threads:[~2004-11-13 13:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-11 16:21 [Bug c++/18429] New: ICE for g++-3.3.5/ endless loop for g++-3.4.3 (template and namespace) andre dot maute at gmx dot de
2004-11-11 16:51 ` [Bug c++/18429] [4.0 Regression] ICE on invalid code with array size being a non constant variable pinskia at gcc dot gnu dot org
2004-11-12 19:29 ` mmitchel at gcc dot gnu dot org
2004-11-12 21:47 ` cvs-commit at gcc dot gnu dot org
2004-11-12 21:58 ` mmitchel at gcc dot gnu dot org
2004-11-13 13:08 ` reichelt 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).