public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters
@ 2006-07-11 13:43 reichelt at gcc dot gnu dot org
2006-07-11 13:43 ` [Bug c++/28341] " reichelt at gcc dot gnu dot org
` (10 more replies)
0 siblings, 11 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-07-11 13:43 UTC (permalink / raw)
To: gcc-bugs
The following (IMHO invalid) code snippet triggers an ICE since GCC 4.0.0:
=========================================
template<const int&> struct A {};
template<typename T> struct B
{
A<T(0)> a;
};
B<const int&> b;
=========================================
bug.cc: In instantiation of 'B<const int&>':
bug.cc:8: instantiated from here
bug.cc:5: internal compiler error: tree check: expected tree that contains
'decl minimal' structure, have 'indirect_ref' in decl_linkage, at
cp/tree.c:2191
Please submit a full bug report, [etc.]
Before GCC 4.0.0 the following (not too helpful, if not bogus) error
message was issued:
bug.cc: In instantiation of `B<const int&>':
bug.cc:8: instantiated from here
bug.cc:5: error: `0' is not a valid template argument
--
Summary: [4.0/4.1/4.2 regression] ICE with references as template
parameters
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.0/4.1/4.2 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
@ 2006-07-11 13:43 ` reichelt at gcc dot gnu dot org
2006-07-17 3:13 ` mmitchel at gcc dot gnu dot org
` (9 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-07-11 13:43 UTC (permalink / raw)
To: gcc-bugs
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.0.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.0/4.1/4.2 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
2006-07-11 13:43 ` [Bug c++/28341] " reichelt at gcc dot gnu dot org
@ 2006-07-17 3:13 ` mmitchel at gcc dot gnu dot org
2006-08-12 21:40 ` janis at gcc dot gnu dot org
` (8 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-07-17 3:13 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.0/4.1/4.2 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
2006-07-11 13:43 ` [Bug c++/28341] " reichelt at gcc dot gnu dot org
2006-07-17 3:13 ` mmitchel at gcc dot gnu dot org
@ 2006-08-12 21:40 ` janis at gcc dot gnu dot org
2006-08-14 19:04 ` reichelt at gcc dot gnu dot org
` (7 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: janis at gcc dot gnu dot org @ 2006-08-12 21:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from janis at gcc dot gnu dot org 2006-08-12 21:40 -------
A regression hunt on powerpc-linux identified the following patch:
http://gcc.gnu.org/viewcvs?view=rev&rev=90059
r90059 | giovannibajo | 2004-11-04 13:07:35 +0000 (Thu, 04 Nov 2004)
--
janis at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |giovannibajo at gcc dot gnu
| |dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.0/4.1/4.2 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2006-08-12 21:40 ` janis at gcc dot gnu dot org
@ 2006-08-14 19:04 ` reichelt at gcc dot gnu dot org
2006-08-17 3:41 ` mmitchel at gcc dot gnu dot org
` (6 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-08-14 19:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from reichelt at gcc dot gnu dot org 2006-08-14 19:04 -------
Reproduced by Janis.
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2006-08-14 19:04:39
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.0/4.1/4.2 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2006-08-14 19:04 ` reichelt at gcc dot gnu dot org
@ 2006-08-17 3:41 ` mmitchel at gcc dot gnu dot org
2006-08-20 23:53 ` mmitchel at gcc dot gnu dot org
` (5 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-08-17 3:41 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
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=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.0/4.1/4.2 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2006-08-17 3:41 ` mmitchel at gcc dot gnu dot org
@ 2006-08-20 23:53 ` mmitchel at gcc dot gnu dot org
2006-08-20 23:59 ` [Bug c++/28341] [4.0/4.1 " mmitchel at gcc dot gnu dot org
` (4 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-08-20 23:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from mmitchel at gcc dot gnu dot org 2006-08-20 23:53 -------
Subject: Bug 28341
Author: mmitchel
Date: Sun Aug 20 23:53:10 2006
New Revision: 116276
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116276
Log:
PR c++/28341
* tree.c (cast_valid_in_integral_constant_expression_p): New
function.
* cp-tree.h (tsubst_copy_and_build): Adjust prototype.
* pt.c (tsubst_expr): Add integral_constant_expression_p
parameter.
(fold_non_dependent_expr): Adjust callers of
tsubst_{expr,copy_and_build}.
(tsubst_friend_function): Likewise.
(tsubst_template_arg): Likewise.
(tsubst_default_argument): Likewise.
(tsubst_decl): Likewise.
(tsubst): Likewise.
(tsubst_omp_clasuses): Likewise.
(regenerate_decl_fromp_template): Likewise.
(instantiate_decl): Likewise.
(tsubst_initializer_list): Likewise.
(tsubst_enum): Likewise.
(tsubst_expr): Use RECUR throughout.
(tsubst_copy_and_build): Change definition of RECUR. Do not allow
invalid casts in integral constant expressions.
* parser.c (cp_parser_postfix_expression): Use
cast_valid_in_integral_constant_expression_p.
(cp_parser_cast_expression): Likewise.
(cp_parser_functional_cast): Likewise.
PR c++/28346
* pt.c (tsubst_qualified_id): Do not strip references from
OFFSET_REFs.
2006-08-20 Mark Mitchell <mark@codesourcery.com>
PR c++/28341
* g++.dg/template/ref3.C: New test.
* g++.dg/template/nontype13.C: New test.
PR c++/28346
* g++.dg/template/ptrmem17.C: New test.
2006-08-20 Mark Mitchell <mark@codesourcery.com>
* objcp-lang.c (objcp_tsubst_copy_and_build): Adjust call to
tsubst_copy_and_build.
Added:
trunk/gcc/testsuite/g++.dg/template/ptrmem17.C
trunk/gcc/testsuite/g++.dg/template/ref3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/parser.c
trunk/gcc/cp/pt.c
trunk/gcc/cp/tree.c
trunk/gcc/objcp/ChangeLog
trunk/gcc/objcp/objcp-lang.c
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/g++.dg/template/nontype13.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.0/4.1 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2006-08-20 23:53 ` mmitchel at gcc dot gnu dot org
@ 2006-08-20 23:59 ` mmitchel at gcc dot gnu dot org
2007-02-03 18:01 ` gdr at gcc dot gnu dot org
` (3 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-08-20 23:59 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from mmitchel at gcc dot gnu dot org 2006-08-20 23:59 -------
Fixed in 4.2.0.
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.0/4.1/4.2 regression] ICE|[4.0/4.1 regression] ICE
|with references as template |with references as template
|parameters |parameters
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.0/4.1 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
` (6 preceding siblings ...)
2006-08-20 23:59 ` [Bug c++/28341] [4.0/4.1 " mmitchel at gcc dot gnu dot org
@ 2007-02-03 18:01 ` gdr at gcc dot gnu dot org
2007-02-03 20:49 ` pinskia at gcc dot gnu dot org
` (2 subsequent siblings)
10 siblings, 0 replies; 12+ messages in thread
From: gdr at gcc dot gnu dot org @ 2007-02-03 18:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from gdr at gcc dot gnu dot org 2007-02-03 18:01 -------
Won't fix in GCC0-4.0.x. Adjusting milestone.
--
gdr at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.0.4 |4.1.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.0/4.1 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
` (7 preceding siblings ...)
2007-02-03 18:01 ` gdr at gcc dot gnu dot org
@ 2007-02-03 20:49 ` pinskia at gcc dot gnu dot org
2007-02-14 9:13 ` mmitchel at gcc dot gnu dot org
2008-07-04 15:41 ` [Bug c++/28341] [4.1 " jsm28 at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-02-03 20:49 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.1.3 |4.1.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.0/4.1 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
` (8 preceding siblings ...)
2007-02-03 20:49 ` pinskia at gcc dot gnu dot org
@ 2007-02-14 9:13 ` mmitchel at gcc dot gnu dot org
2008-07-04 15:41 ` [Bug c++/28341] [4.1 " jsm28 at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-02-14 9:13 UTC (permalink / raw)
To: gcc-bugs
--
mmitchel at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.1.2 |4.1.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bug c++/28341] [4.1 regression] ICE with references as template parameters
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
` (9 preceding siblings ...)
2007-02-14 9:13 ` mmitchel at gcc dot gnu dot org
@ 2008-07-04 15:41 ` jsm28 at gcc dot gnu dot org
10 siblings, 0 replies; 12+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 15:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jsm28 at gcc dot gnu dot org 2008-07-04 15:41 -------
Closing 4.1 branch.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to fail|4.0.4 |4.0.4 4.1.3
Known to work| |4.2.0
Resolution| |FIXED
Target Milestone|4.1.3 |4.2.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28341
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2008-07-04 15:41 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-11 13:43 [Bug c++/28341] New: [4.0/4.1/4.2 regression] ICE with references as template parameters reichelt at gcc dot gnu dot org
2006-07-11 13:43 ` [Bug c++/28341] " reichelt at gcc dot gnu dot org
2006-07-17 3:13 ` mmitchel at gcc dot gnu dot org
2006-08-12 21:40 ` janis at gcc dot gnu dot org
2006-08-14 19:04 ` reichelt at gcc dot gnu dot org
2006-08-17 3:41 ` mmitchel at gcc dot gnu dot org
2006-08-20 23:53 ` mmitchel at gcc dot gnu dot org
2006-08-20 23:59 ` [Bug c++/28341] [4.0/4.1 " mmitchel at gcc dot gnu dot org
2007-02-03 18:01 ` gdr at gcc dot gnu dot org
2007-02-03 20:49 ` pinskia at gcc dot gnu dot org
2007-02-14 9:13 ` mmitchel at gcc dot gnu dot org
2008-07-04 15:41 ` [Bug c++/28341] [4.1 " jsm28 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).