public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17524] New: ICE with initializing a variable of type void
@ 2004-09-16 16:30 bangerth at dealii dot org
  2004-09-16 19:58 ` [Bug c++/17524] [3.3/3.4/4.0 regression] " reichelt at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2004-09-16 16:30 UTC (permalink / raw)
  To: gcc-bugs

Spinoff from PR 17344: 
---------------------------------- 
template <typename T> struct intTraits { 
    static const T i = 0; 
}; 
 
struct S { 
    S(intTraits<void>); 
}; 
 
template <typename> struct A {}; 
 
int bar(S); 
int bar(A<int>); 
 
S *s; 
int i = bar(*s); 
------------------------ 
 
We shouldn't ICE here: 
g/x> /home/bangerth/bin/gcc-4.0-pre/bin/c++ -c x.cc 
x.cc: In instantiation of `intTraits<void>': 
x.cc:15:   instantiated from here 
x.cc:2: error: instantiation of `intTraits<void>::i' as type `const void' 
x.cc:2: error: `intTraits<void>::i' has incomplete type 
x.cc:2: error: invalid in-class initialization of static data member of 
non-integral type `<type error>' 
x.cc:1: internal compiler error: tree check: expected class 't', have 
'x' (error_mark) in finish_struct_1, at cp/class.c:5065 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
W.

-- 
           Summary: ICE with initializing a variable of type void
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/17524] [3.3/3.4/4.0 regression] ICE with initializing a variable of type void
  2004-09-16 16:30 [Bug c++/17524] New: ICE with initializing a variable of type void bangerth at dealii dot org
@ 2004-09-16 19:58 ` reichelt at gcc dot gnu dot org
  2004-10-03 23:49 ` mmitchel at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-09-16 19:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-09-16 19:58 -------
Here's something shorter:

==============================
template<typename T> struct A
{
    static const T i;
};

A<void> a;
==============================

We ICE since gcc 3.0.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
           Keywords|                            |ice-on-invalid-code,
                   |                            |monitored
      Known to fail|                            |3.0 3.4.2 4.0.0
      Known to work|                            |2.95.3
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-16 19:58:55
               date|                            |
            Summary|ICE with initializing a     |[3.3/3.4/4.0 regression] ICE
                   |variable of type void       |with initializing a variable
                   |                            |of type void
   Target Milestone|---                         |3.4.3


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


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

* [Bug c++/17524] [3.3/3.4/4.0 regression] ICE with initializing a variable of type void
  2004-09-16 16:30 [Bug c++/17524] New: ICE with initializing a variable of type void bangerth at dealii dot org
  2004-09-16 19:58 ` [Bug c++/17524] [3.3/3.4/4.0 regression] " reichelt at gcc dot gnu dot org
@ 2004-10-03 23:49 ` mmitchel at gcc dot gnu dot org
  2004-10-03 23:58 ` reichelt at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-03 23:49 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=17524


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

* [Bug c++/17524] [3.3/3.4/4.0 regression] ICE with initializing a variable of type void
  2004-09-16 16:30 [Bug c++/17524] New: ICE with initializing a variable of type void bangerth at dealii dot org
  2004-09-16 19:58 ` [Bug c++/17524] [3.3/3.4/4.0 regression] " reichelt at gcc dot gnu dot org
  2004-10-03 23:49 ` mmitchel at gcc dot gnu dot org
@ 2004-10-03 23:58 ` reichelt at gcc dot gnu dot org
  2004-10-09 17:33 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-10-03 23:58 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-10-03 23:58 -------
Sorry, I meant of course:

=============================
template<typename T> struct A
{
    static const T i = 0;
};

A<void> a;
=============================


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery, ice-checking


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


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

* [Bug c++/17524] [3.3/3.4/4.0 regression] ICE with initializing a variable of type void
  2004-09-16 16:30 [Bug c++/17524] New: ICE with initializing a variable of type void bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2004-10-03 23:58 ` reichelt at gcc dot gnu dot org
@ 2004-10-09 17:33 ` cvs-commit at gcc dot gnu dot org
  2004-10-09 17:55 ` cvs-commit at gcc dot gnu dot org
  2004-10-09 17:57 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-09 17:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-09 17:33 -------
Subject: Bug 17524

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2004-10-09 17:33:02

Modified files:
	gcc/testsuite  : ChangeLog 
	gcc/cp         : ChangeLog cp-tree.h decl.c pt.c 
Added files:
	gcc/testsuite/g++.dg/parse: operator5.C 
	gcc/testsuite/g++.dg/template: static9.C 

Log message:
	PR c++/17524
	* cp-tree.h (check_var_type): New function.
	* decl.c (check_var_type): New function, split out from ...
	(grokdeclarator): ... here.
	* pt.c (tsubst_decl): Use check_var_type.
	
	PR c++/17685
	* decl.c (grokdeclarator): Disallow declarations of operators as
	
	PR c++/17524
	* g++.dg/template/static9.C: New test.
	
	PR c++/17685
	* g++.dg/parse/operator5.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4419&r2=1.4420
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4415&r2=1.4416
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.1058&r2=1.1059
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1311&r2=1.1312
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.933&r2=1.934
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/operator5.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static9.C.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


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


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

* [Bug c++/17524] [3.3/3.4/4.0 regression] ICE with initializing a variable of type void
  2004-09-16 16:30 [Bug c++/17524] New: ICE with initializing a variable of type void bangerth at dealii dot org
                   ` (3 preceding siblings ...)
  2004-10-09 17:33 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-09 17:55 ` cvs-commit at gcc dot gnu dot org
  2004-10-09 17:57 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-10-09 17:55 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-09 17:55 -------
Subject: Bug 17524

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	mmitchel@gcc.gnu.org	2004-10-09 17:55:31

Modified files:
	gcc/cp         : ChangeLog cp-tree.h decl.c pt.c 
Added files:
	gcc/testsuite/g++.dg/parse: operator5.C 
	gcc/testsuite/g++.dg/template: static9.C 

Log message:
	PR c++/17524
	* cp-tree.h (check_var_type): New function.
	* decl.c (check_var_type): New function, split out from ...
	(grokdeclarator): ... here.
	* pt.c (tsubst_decl): Use check_var_type.
	
	PR c++/17685
	* decl.c (grokdeclarator): Disallow declarations of operators as
	non-functions.
	
	PR c++/17524
	* g++.dg/template/static9.C: New test.
	
	PR c++/17685
	* g++.dg/parse/operator5.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.164&r2=1.3892.2.165
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.946.4.16&r2=1.946.4.17
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.1174.2.24&r2=1.1174.2.25
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.42&r2=1.816.2.43
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/operator5.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/static9.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1



-- 


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


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

* [Bug c++/17524] [3.3/3.4/4.0 regression] ICE with initializing a variable of type void
  2004-09-16 16:30 [Bug c++/17524] New: ICE with initializing a variable of type void bangerth at dealii dot org
                   ` (4 preceding siblings ...)
  2004-10-09 17:55 ` cvs-commit at gcc dot gnu dot org
@ 2004-10-09 17:57 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-10-09 17:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From mmitchel at gcc dot gnu dot org  2004-10-09 17:57 -------
Fixed in GCC 3.4.3.

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


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


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

end of thread, other threads:[~2004-10-09 17:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-16 16:30 [Bug c++/17524] New: ICE with initializing a variable of type void bangerth at dealii dot org
2004-09-16 19:58 ` [Bug c++/17524] [3.3/3.4/4.0 regression] " reichelt at gcc dot gnu dot org
2004-10-03 23:49 ` mmitchel at gcc dot gnu dot org
2004-10-03 23:58 ` reichelt at gcc dot gnu dot org
2004-10-09 17:33 ` cvs-commit at gcc dot gnu dot org
2004-10-09 17:55 ` cvs-commit at gcc dot gnu dot org
2004-10-09 17:57 ` mmitchel 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).