public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions
@ 2014-02-15 21:10 reichelt at gcc dot gnu.org
2014-02-15 21:11 ` [Bug c++/60216] " reichelt at gcc dot gnu.org
` (8 more replies)
0 siblings, 9 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-15 21:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60216
Bug ID: 60216
Summary: [4.8/4.9 Regression] [c++11] Trouble with deleted
template functions
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Keywords: accepts-invalid, ice-on-invalid-code
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: reichelt at gcc dot gnu.org
The following invalid code snippet (compiled with "-std=c++11") triggers an
ICE since GCC 4.8.1:
============================================
struct A
{
template<typename T> A(T) = delete;
};
template<> A::A<int>(int) {}
A a(0);
============================================
bug.cc:8:6: error: use of deleted function 'A::A(T) [with T = int]'
A a(0);
^
bug.cc:8:6: internal compiler error: in maybe_explain_implicit_delete, at
cp/method.c:1422
0x7177c2 maybe_explain_implicit_delete(tree_node*)
../../gcc/gcc/cp/method.c:1422
0x6871f8 mark_used(tree_node*, int)
../../gcc/gcc/cp/decl2.c:4656
0x5b1349 build_over_call
../../gcc/gcc/cp/call.c:7188
0x5b3d0a build_new_method_call_1
../../gcc/gcc/cp/call.c:7887
0x5b3d0a build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, tree_node*, int, tree_node**, int)
../../gcc/gcc/cp/call.c:7957
0x5b4d79 build_special_member_call(tree_node*, tree_node*, vec<tree_node*,
va_gc, vl_embed>**, tree_node*, int, int)
../../gcc/gcc/cp/call.c:7513
0x7080e9 expand_default_init
../../gcc/gcc/cp/init.c:1677
0x7080e9 expand_aggr_init_1
../../gcc/gcc/cp/init.c:1778
0x70adf3 build_aggr_init(tree_node*, tree_node*, int, int)
../../gcc/gcc/cp/init.c:1529
0x5c7454 build_aggr_init_full_exprs
../../gcc/gcc/cp/decl.c:5591
0x5c7454 check_initializer
../../gcc/gcc/cp/decl.c:5727
0x5d99fc cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/gcc/cp/decl.c:6396
0x6c81bd cp_parser_init_declarator
../../gcc/gcc/cp/parser.c:16815
0x6c9979 cp_parser_simple_declaration
../../gcc/gcc/cp/parser.c:11205
0x6acc63 cp_parser_block_declaration
../../gcc/gcc/cp/parser.c:11086
0x6d3f12 cp_parser_declaration
../../gcc/gcc/cp/parser.c:10983
0x6d2c08 cp_parser_declaration_seq_opt
../../gcc/gcc/cp/parser.c:10869
0x6d44aa cp_parser_translation_unit
../../gcc/gcc/cp/parser.c:4014
0x6d44aa c_parse_file()
../../gcc/gcc/cp/parser.c:31536
0x7f3813 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]
A similar testcase is wrongly accepted since GCC 4.8.1:
============================================
struct A
{
template<typename T> void foo(T) = delete;
};
template<> void A::foo<int>(int) {}
void bar()
{
A().foo(0);
}
============================================
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/60216] [4.8/4.9 Regression] [c++11] Trouble with deleted template functions
2014-02-15 21:10 [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions reichelt at gcc dot gnu.org
@ 2014-02-15 21:11 ` reichelt at gcc dot gnu.org
2014-02-16 19:35 ` reichelt at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-15 21:11 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60216
Volker Reichelt <reichelt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.8.0
Target Milestone|--- |4.8.4
Known to fail| |4.8.1, 4.8.2, 4.9.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/60216] [4.8/4.9 Regression] [c++11] Trouble with deleted template functions
2014-02-15 21:10 [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions reichelt at gcc dot gnu.org
2014-02-15 21:11 ` [Bug c++/60216] " reichelt at gcc dot gnu.org
@ 2014-02-16 19:35 ` reichelt at gcc dot gnu.org
2014-02-17 10:10 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-16 19:35 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60216
Volker Reichelt <reichelt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.8.4 |4.8.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/60216] [4.8/4.9 Regression] [c++11] Trouble with deleted template functions
2014-02-15 21:10 [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions reichelt at gcc dot gnu.org
2014-02-15 21:11 ` [Bug c++/60216] " reichelt at gcc dot gnu.org
2014-02-16 19:35 ` reichelt at gcc dot gnu.org
@ 2014-02-17 10:10 ` jakub at gcc dot gnu.org
2014-02-17 12:26 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-02-17 10:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60216
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2014-02-17
CC| |jakub at gcc dot gnu.org,
| |jason at gcc dot gnu.org
Version|4.9.0 |4.8.3
Ever confirmed|0 |1
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Started with r198098 (or r198099, but that seems unrelated, r198096 works,
r198100 fails).
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/60216] [4.8/4.9 Regression] [c++11] Trouble with deleted template functions
2014-02-15 21:10 [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions reichelt at gcc dot gnu.org
` (2 preceding siblings ...)
2014-02-17 10:10 ` jakub at gcc dot gnu.org
@ 2014-02-17 12:26 ` rguenth at gcc dot gnu.org
2014-02-21 6:10 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-02-17 12:26 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60216
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/60216] [4.8/4.9 Regression] [c++11] Trouble with deleted template functions
2014-02-15 21:10 [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions reichelt at gcc dot gnu.org
` (3 preceding siblings ...)
2014-02-17 12:26 ` rguenth at gcc dot gnu.org
@ 2014-02-21 6:10 ` jason at gcc dot gnu.org
2014-02-21 13:33 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-21 6:10 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60216
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|ice-on-invalid-code |ice-on-valid-code
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Both testcases are valid:
http://open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#941
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/60216] [4.8/4.9 Regression] [c++11] Trouble with deleted template functions
2014-02-15 21:10 [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions reichelt at gcc dot gnu.org
` (4 preceding siblings ...)
2014-02-21 6:10 ` jason at gcc dot gnu.org
@ 2014-02-21 13:33 ` jason at gcc dot gnu.org
2014-02-21 14:57 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-21 13:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60216
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords|accepts-invalid |
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/60216] [4.8/4.9 Regression] [c++11] Trouble with deleted template functions
2014-02-15 21:10 [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions reichelt at gcc dot gnu.org
` (5 preceding siblings ...)
2014-02-21 13:33 ` jason at gcc dot gnu.org
@ 2014-02-21 14:57 ` jason at gcc dot gnu.org
2014-02-21 15:30 ` jason at gcc dot gnu.org
2014-02-21 15:39 ` jason at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-21 14:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60216
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Feb 21 14:57:07 2014
New Revision: 208004
URL: http://gcc.gnu.org/viewcvs?rev=208004&root=gcc&view=rev
Log:
PR c++/60216
* pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
(check_explicit_specialization): Don't clone.
Added:
trunk/gcc/testsuite/g++.dg/cpp0x/deleted3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/60216] [4.8/4.9 Regression] [c++11] Trouble with deleted template functions
2014-02-15 21:10 [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions reichelt at gcc dot gnu.org
` (6 preceding siblings ...)
2014-02-21 14:57 ` jason at gcc dot gnu.org
@ 2014-02-21 15:30 ` jason at gcc dot gnu.org
2014-02-21 15:39 ` jason at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-21 15:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60216
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Feb 21 15:29:32 2014
New Revision: 208008
URL: http://gcc.gnu.org/viewcvs?rev=208008&root=gcc&view=rev
Log:
PR c++/60216
* pt.c (register_specialization): Copy DECL_DELETED_FN to clones.
Added:
branches/gcc-4_8-branch/gcc/testsuite/g++.dg/cpp0x/deleted3.C
Modified:
branches/gcc-4_8-branch/gcc/cp/ChangeLog
branches/gcc-4_8-branch/gcc/cp/pt.c
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/60216] [4.8/4.9 Regression] [c++11] Trouble with deleted template functions
2014-02-15 21:10 [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions reichelt at gcc dot gnu.org
` (7 preceding siblings ...)
2014-02-21 15:30 ` jason at gcc dot gnu.org
@ 2014-02-21 15:39 ` jason at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-21 15:39 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60216
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.8.3/4.9.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-02-21 15:39 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15 21:10 [Bug c++/60216] New: [4.8/4.9 Regression] [c++11] Trouble with deleted template functions reichelt at gcc dot gnu.org
2014-02-15 21:11 ` [Bug c++/60216] " reichelt at gcc dot gnu.org
2014-02-16 19:35 ` reichelt at gcc dot gnu.org
2014-02-17 10:10 ` jakub at gcc dot gnu.org
2014-02-17 12:26 ` rguenth at gcc dot gnu.org
2014-02-21 6:10 ` jason at gcc dot gnu.org
2014-02-21 13:33 ` jason at gcc dot gnu.org
2014-02-21 14:57 ` jason at gcc dot gnu.org
2014-02-21 15:30 ` jason at gcc dot gnu.org
2014-02-21 15:39 ` jason at gcc dot gnu.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).