public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361
@ 2015-03-11 15:37 alserkli at inbox dot ru
  2015-03-16  9:09 ` [Bug c++/65390] " mpolacek at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: alserkli at inbox dot ru @ 2015-03-11 15:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

            Bug ID: 65390
           Summary: ICE in strip_typedefs, at cp/tree.c:1361
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alserkli at inbox dot ru

Created attachment 35013
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35013&action=edit
preprocessed source

g++ (GCC) 5.0.0 20150311 (experimental)

=== e.cc ===
#include <memory>
auto f(int n){
  return std::make_shared<int[n]>();
}
===

$ g++ -std=c++14 e.cc
In file included from /opt/include/c++/5.0.0/memory:82:0,
                 from e.cc:1:
/opt/include/c++/5.0.0/bits/shared_ptr.h: In substitution of 'template<class
_Tp, class ... _Args> std::shared_ptr<_Tp1> std::make_shared(_Args&& ...) [with
_Tp = int [n]; _Args = {}]':
e.cc:3:35:   required from here
/opt/include/c++/5.0.0/bits/shared_ptr.h:626:5: internal compiler error: in
strip_typedefs, at cp/tree.c:1361
     make_shared(_Args&&... __args)
     ^
0x7bbc4d strip_typedefs(tree_node*)
    /gcc/gcc/cp/tree.c:1361
0x6534d2 canonicalize_type_argument
    /gcc/gcc/cp/pt.c:6500
0x67f7fa coerce_template_parms
    /gcc/gcc/cp/pt.c:7171
0x681789 lookup_template_class_1
    /gcc/gcc/cp/pt.c:7780
0x681789 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
    /gcc/gcc/cp/pt.c:8096
0x684cd8 tsubst_aggr_type
    /gcc/gcc/cp/pt.c:10460
0x67704b tsubst(tree_node*, tree_node*, int, tree_node*)
    /gcc/gcc/cp/pt.c:11909
0x68bc6f tsubst_function_type
    /gcc/gcc/cp/pt.c:11624
0x677186 tsubst(tree_node*, tree_node*, int, tree_node*)
    /gcc/gcc/cp/pt.c:12357
0x6a219d fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
    /gcc/gcc/cp/pt.c:16259
0x615479 add_template_candidate_real
    /gcc/gcc/cp/call.c:3057
0x615f0c add_template_candidate
    /gcc/gcc/cp/call.c:3154
0x615f0c add_candidates
    /gcc/gcc/cp/call.c:5285
0x6163d3 perform_overload_resolution
    /gcc/gcc/cp/call.c:4003
0x6188ca build_new_function_call(tree_node*, vec<tree_node*, va_gc,
vl_embed>**, bool, int)
    /gcc/gcc/cp/call.c:4080
0x7907d1 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool,
bool, int)
    /gcc/gcc/cp/semantics.c:2407
0x7147e1 cp_parser_postfix_expression
    /gcc/gcc/cp/parser.c:6368
0x71c349 cp_parser_unary_expression
    /gcc/gcc/cp/parser.c:7438
0x71d047 cp_parser_binary_expression
    /gcc/gcc/cp/parser.c:8172
0x71d87f cp_parser_assignment_expression
    /gcc/gcc/cp/parser.c:8430


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

* [Bug c++/65390] ICE in strip_typedefs, at cp/tree.c:1361
  2015-03-11 15:37 [Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361 alserkli at inbox dot ru
@ 2015-03-16  9:09 ` mpolacek at gcc dot gnu.org
  2015-03-16  9:15 ` mpolacek at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-16  9:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-16
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.  It appears that 4.9/4.8 ICE too.


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

* [Bug c++/65390] ICE in strip_typedefs, at cp/tree.c:1361
  2015-03-11 15:37 [Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361 alserkli at inbox dot ru
  2015-03-16  9:09 ` [Bug c++/65390] " mpolacek at gcc dot gnu.org
@ 2015-03-16  9:15 ` mpolacek at gcc dot gnu.org
  2015-03-16  9:22 ` alserkli at inbox dot ru
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-16  9:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Might be a dup of PR63584.


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

* [Bug c++/65390] ICE in strip_typedefs, at cp/tree.c:1361
  2015-03-11 15:37 [Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361 alserkli at inbox dot ru
  2015-03-16  9:09 ` [Bug c++/65390] " mpolacek at gcc dot gnu.org
  2015-03-16  9:15 ` mpolacek at gcc dot gnu.org
@ 2015-03-16  9:22 ` alserkli at inbox dot ru
  2015-03-16 13:38 ` ktietz at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: alserkli at inbox dot ru @ 2015-03-16  9:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

--- Comment #3 from Alexander Klimov <alserkli at inbox dot ru> ---
(In reply to Marek Polacek from comment #2)
> Might be a dup of PR63584.

PR63584 does not produce ICE in 5.0


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

* [Bug c++/65390] ICE in strip_typedefs, at cp/tree.c:1361
  2015-03-11 15:37 [Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361 alserkli at inbox dot ru
                   ` (2 preceding siblings ...)
  2015-03-16  9:22 ` alserkli at inbox dot ru
@ 2015-03-16 13:38 ` ktietz at gcc dot gnu.org
  2015-03-16 13:38 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: ktietz at gcc dot gnu.org @ 2015-03-16 13:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

Kai Tietz <ktietz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
                 CC|                            |ktietz at gcc dot gnu.org

--- Comment #4 from Kai Tietz <ktietz at gcc dot gnu.org> ---
This sample is undefined behavior.  It will use delete on the allocated memory,
and not delete [] as it would need.
Additionally the type 'int [n]' is no valid type for template argument.


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

* [Bug c++/65390] ICE in strip_typedefs, at cp/tree.c:1361
  2015-03-11 15:37 [Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361 alserkli at inbox dot ru
                   ` (3 preceding siblings ...)
  2015-03-16 13:38 ` ktietz at gcc dot gnu.org
@ 2015-03-16 13:38 ` redi at gcc dot gnu.org
  2015-03-16 13:41 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-16 13:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced:

template<typename T> struct shared_ptr { };

template<typename T, typename Arg>
shared_ptr<T> make_shared(Arg) { return {}; }

auto f(int n){
  return make_shared<int[n]>(1);
}


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

* [Bug c++/65390] ICE in strip_typedefs, at cp/tree.c:1361
  2015-03-11 15:37 [Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361 alserkli at inbox dot ru
                   ` (4 preceding siblings ...)
  2015-03-16 13:38 ` redi at gcc dot gnu.org
@ 2015-03-16 13:41 ` redi at gcc dot gnu.org
  2015-03-31 17:54 ` mpolacek at gcc dot gnu.org
  2015-03-31 17:58 ` mpolacek at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2015-03-16 13:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Further reduced so it doesn't rely on any C++11 or C++14 features:

template<typename T> struct shared_ptr { };

template<typename T, typename Arg>
shared_ptr<T> make_shared(Arg) { return shared_ptr<T>(); }

void f(int n){
  make_shared<int[n]>(1);
}


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

* [Bug c++/65390] ICE in strip_typedefs, at cp/tree.c:1361
  2015-03-11 15:37 [Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361 alserkli at inbox dot ru
                   ` (5 preceding siblings ...)
  2015-03-16 13:41 ` redi at gcc dot gnu.org
@ 2015-03-31 17:54 ` mpolacek at gcc dot gnu.org
  2015-03-31 17:58 ` mpolacek at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-31 17:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Tue Mar 31 17:35:29 2015
New Revision: 221799

URL: https://gcc.gnu.org/viewcvs?rev=221799&root=gcc&view=rev
Log:
    PR c++/65390
    * tree.c (build_cplus_array_type): Use dependent_type_p rather than
    checking for constness.

    * g++.dg/template/pr65390.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/template/pr65390.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/65390] ICE in strip_typedefs, at cp/tree.c:1361
  2015-03-11 15:37 [Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361 alserkli at inbox dot ru
                   ` (6 preceding siblings ...)
  2015-03-31 17:54 ` mpolacek at gcc dot gnu.org
@ 2015-03-31 17:58 ` mpolacek at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-03-31 17:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |5.0

--- Comment #8 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed for GCC 5.


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

end of thread, other threads:[~2015-03-31 17:37 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 15:37 [Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361 alserkli at inbox dot ru
2015-03-16  9:09 ` [Bug c++/65390] " mpolacek at gcc dot gnu.org
2015-03-16  9:15 ` mpolacek at gcc dot gnu.org
2015-03-16  9:22 ` alserkli at inbox dot ru
2015-03-16 13:38 ` ktietz at gcc dot gnu.org
2015-03-16 13:38 ` redi at gcc dot gnu.org
2015-03-16 13:41 ` redi at gcc dot gnu.org
2015-03-31 17:54 ` mpolacek at gcc dot gnu.org
2015-03-31 17:58 ` mpolacek 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).