* [Bug c++/32241] Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template
2007-06-07 10:30 [Bug c++/32241] New: Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template rsalmin2 at cc dot hut dot fi
@ 2007-06-07 10:31 ` rsalmin2 at cc dot hut dot fi
2007-06-08 0:03 ` fang at csl dot cornell dot edu
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rsalmin2 at cc dot hut dot fi @ 2007-06-07 10:31 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rsalmin2 at cc dot hut dot fi 2007-06-07 10:30 -------
Created an attachment (id=13663)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13663&action=view)
Source code and preprocessed source
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32241
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32241] Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template
2007-06-07 10:30 [Bug c++/32241] New: Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template rsalmin2 at cc dot hut dot fi
2007-06-07 10:31 ` [Bug c++/32241] " rsalmin2 at cc dot hut dot fi
@ 2007-06-08 0:03 ` fang at csl dot cornell dot edu
2007-06-08 10:16 ` rguenth at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: fang at csl dot cornell dot edu @ 2007-06-08 0:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from fang at csl dot cornell dot edu 2007-06-08 00:03 -------
reduced test case:
==============================
template <typename T>
class SimpleStack {
public:
T& top() { return *ptr; }
void pop() { top.~T(); }
T *ptr;
};
int main(int, char*[]) {
SimpleStack<int> stack;
stack.pop();
return 0;
}
==============================
also ICEs 4.0.1 (apple) and 4.2.0.
keyword: ice-on-invalid
known to fail: 4.0.1, 4.2.0
3.3 (apple) gives:
error: destructor name `~int' does not match type `<unknown type>' of
expression
error: insufficient contextual information to determine type
3.4.6 silently accepts code and compiles.
Note: author probably meant "top().~T()" :)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32241
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32241] Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template
2007-06-07 10:30 [Bug c++/32241] New: Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template rsalmin2 at cc dot hut dot fi
2007-06-07 10:31 ` [Bug c++/32241] " rsalmin2 at cc dot hut dot fi
2007-06-08 0:03 ` fang at csl dot cornell dot edu
@ 2007-06-08 10:16 ` rguenth at gcc dot gnu dot org
2007-06-09 22:20 ` [Bug c++/32241] [4.1/4.2/4.3 regression] ICE trying to call x.~X(); " reichelt at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-06-08 10:16 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2007-06-08 10:16 -------
Confirmed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |ice-on-invalid-code
Last reconfirmed|0000-00-00 00:00:00 |2007-06-08 10:16:34
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32241
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32241] [4.1/4.2/4.3 regression] ICE trying to call x.~X(); in a template
2007-06-07 10:30 [Bug c++/32241] New: Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template rsalmin2 at cc dot hut dot fi
` (2 preceding siblings ...)
2007-06-08 10:16 ` rguenth at gcc dot gnu dot org
@ 2007-06-09 22:20 ` reichelt at gcc dot gnu dot org
2007-06-29 18:41 ` mmitchel at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-06-09 22:20 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from reichelt at gcc dot gnu dot org 2007-06-09 22:20 -------
Even shorter testcase:
=================================
template<typename T> struct A
{
T& foo();
A() { foo.~T(); }
};
A<int> a;
=================================
With checking enabled I get the following crash:
bug.cc: In constructor 'A<T>::A() [with T = int]':
bug.cc:8: instantiated from here
bug.cc:5: internal compiler error: tree check: expected field_decl, have
baselink in component_ref_field_offset, at expr.c:5960
Please submit a full bug report, [etc.]
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |reichelt at gcc dot gnu dot
| |org
Keywords| |monitored
Summary|Compiler segmentation fault |[4.1/4.2/4.3 regression] ICE
|when trying to call x.~X(); |trying to call x.~X(); in a
|(X &x = f();) in a template |template
Target Milestone|--- |4.1.3
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32241
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32241] [4.1/4.2/4.3 regression] ICE trying to call x.~X(); in a template
2007-06-07 10:30 [Bug c++/32241] New: Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template rsalmin2 at cc dot hut dot fi
` (3 preceding siblings ...)
2007-06-09 22:20 ` [Bug c++/32241] [4.1/4.2/4.3 regression] ICE trying to call x.~X(); " reichelt at gcc dot gnu dot org
@ 2007-06-29 18:41 ` mmitchel at gcc dot gnu dot org
2007-11-08 11:49 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-06-29 18:41 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=32241
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32241] [4.1/4.2/4.3 regression] ICE trying to call x.~X(); in a template
2007-06-07 10:30 [Bug c++/32241] New: Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template rsalmin2 at cc dot hut dot fi
` (4 preceding siblings ...)
2007-06-29 18:41 ` mmitchel at gcc dot gnu dot org
@ 2007-11-08 11:49 ` jakub at gcc dot gnu dot org
2007-11-10 7:36 ` jakub at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-08 11:49 UTC (permalink / raw)
To: gcc-bugs
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2007-
| |11/msg00407.html
Status|NEW |ASSIGNED
Last reconfirmed|2007-06-08 10:16:34 |2007-11-08 11:49:23
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32241
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32241] [4.1/4.2/4.3 regression] ICE trying to call x.~X(); in a template
2007-06-07 10:30 [Bug c++/32241] New: Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template rsalmin2 at cc dot hut dot fi
` (5 preceding siblings ...)
2007-11-08 11:49 ` jakub at gcc dot gnu dot org
@ 2007-11-10 7:36 ` jakub at gcc dot gnu dot org
2007-11-10 7:53 ` [Bug c++/32241] [4.1/4.2 " jakub at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-10 7:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jakub at gcc dot gnu dot org 2007-11-10 07:36 -------
Subject: Bug 32241
Author: jakub
Date: Sat Nov 10 07:36:09 2007
New Revision: 130066
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=130066
Log:
PR c++/32241
* pt.c (tsubst_copy_and_build) <case COMPONENT_REF>: If object_type
is not scalar type, let finish_class_member_access_expr handle
diagnostics. Pass BIT_NOT_EXPR argument to
finish_pseudo_destructor_expr. Handle SCOPE_REF properly.
* g++.dg/template/pseudodtor3.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/template/pseudodtor3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32241
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32241] [4.1/4.2 regression] ICE trying to call x.~X(); in a template
2007-06-07 10:30 [Bug c++/32241] New: Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template rsalmin2 at cc dot hut dot fi
` (6 preceding siblings ...)
2007-11-10 7:36 ` jakub at gcc dot gnu dot org
@ 2007-11-10 7:53 ` jakub at gcc dot gnu dot org
2008-07-04 22:14 ` [Bug c++/32241] [4.2 " jsm28 at gcc dot gnu dot org
2009-03-30 22:01 ` jsm28 at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-10 7:53 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jakub at gcc dot gnu dot org 2007-11-10 07:53 -------
Fixed so far on the trunk.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.1/4.2/4.3 regression] ICE|[4.1/4.2 regression] ICE
|trying to call x.~X(); in a |trying to call x.~X(); in a
|template |template
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32241
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32241] [4.2 regression] ICE trying to call x.~X(); in a template
2007-06-07 10:30 [Bug c++/32241] New: Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template rsalmin2 at cc dot hut dot fi
` (7 preceding siblings ...)
2007-11-10 7:53 ` [Bug c++/32241] [4.1/4.2 " jakub at gcc dot gnu dot org
@ 2008-07-04 22:14 ` jsm28 at gcc dot gnu dot org
2009-03-30 22:01 ` jsm28 at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 22:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jsm28 at gcc dot gnu dot org 2008-07-04 22:13 -------
Closing 4.1 branch.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.1/4.2 regression] ICE |[4.2 regression] ICE trying
|trying to call x.~X(); in a |to call x.~X(); in a
|template |template
Target Milestone|4.1.3 |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32241
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/32241] [4.2 regression] ICE trying to call x.~X(); in a template
2007-06-07 10:30 [Bug c++/32241] New: Compiler segmentation fault when trying to call x.~X(); (X &x = f();) in a template rsalmin2 at cc dot hut dot fi
` (8 preceding siblings ...)
2008-07-04 22:14 ` [Bug c++/32241] [4.2 " jsm28 at gcc dot gnu dot org
@ 2009-03-30 22:01 ` jsm28 at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2009-03-30 22:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jsm28 at gcc dot gnu dot org 2009-03-30 22:00 -------
Closing 4.2 branch, fixed in 4.3.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to fail| |4.2.5
Known to work| |4.3.0
Resolution| |FIXED
Target Milestone|4.2.5 |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32241
^ permalink raw reply [flat|nested] 11+ messages in thread