public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/86862] Segfault using extern template on class deriving from streambuf
       [not found] <bug-86862-4@http.gcc.gnu.org/bugzilla/>
@ 2024-03-26  7:39 ` pinskia at gcc dot gnu.org
  2024-03-26  8:15 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-26  7:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Reduced testcase:
```
namespace std {
template <typename _CharT>  struct char_traits {};
}
template <class Char, template <class> class Traits>
  struct b { virtual ~b(); };
template <class Char>
  struct d : public b<Char, std::char_traits> {};
extern template class d<char>;

```


Note `std::char_traits` needs to be exactly that; otherwise the ICE does not
show up.

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

* [Bug c++/86862] Segfault using extern template on class deriving from streambuf
       [not found] <bug-86862-4@http.gcc.gnu.org/bugzilla/>
  2024-03-26  7:39 ` [Bug c++/86862] Segfault using extern template on class deriving from streambuf pinskia at gcc dot gnu.org
@ 2024-03-26  8:15 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-26  8:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note here is the backtrace:
```
t.cc: In instantiation of ‘class std::base<char, std::char_traits>’:
t.cc:6:7:   required from ‘class std::derived<char>’
    6 | class derived : public base<Char, char_traits> {};
      |       ^~~~~~~
t.cc:7:23:   required from here
    7 | extern template class derived<char>;
      |                       ^~~~~~~~~~~~~
t.cc:4:7: internal compiler error: Segmentation fault
    4 | class base { virtual ~base(); };
      |       ^~~~
0x1341fcf crash_signal
        /home/apinski/src/upstream-gcc-match/gcc/gcc/toplev.cc:319
0xb5fa80 tree_check(tree_node*, char const*, int, char const*, tree_code)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/tree.h:3619
0xb5fa80 is_std_substitution_char
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/mangle.cc:570
0xb6a384 find_substitution
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/mangle.cc:684
0xb670ee write_type
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/mangle.cc:2400
0xb6949f mangle_special_for_type
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/mangle.cc:4581
0xa6b6f5 get_vtable_name
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/class.cc:794
0xa6b6f5 get_vtable_decl(tree_node*, int)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/class.cc:877
0xa7e40f modify_all_vtables
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/class.cc:3112
0xa7e40f finish_struct_1(tree_node*)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/class.cc:7839
0xc8b266 instantiate_class_template(tree_node*)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/pt.cc:12683
0xcdf890 complete_type(tree_node*)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/typeck.cc:138
0xcdfb2d complete_type_or_maybe_complain(tree_node*, tree_node*, int)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/typeck.cc:151
0xcdfb2d complete_type_or_else(tree_node*, tree_node*)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/typeck.cc:169
0xb1049e xref_basetypes(tree_node*, tree_node*)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/decl.cc:16713
0xc8aeed instantiate_class_template(tree_node*)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/pt.cc:12396
0xcdf890 complete_type(tree_node*)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/typeck.cc:138
0xc7f5ea do_type_instantiation(tree_node*, tree_node*, int)
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/pt.cc:26470
0xc28075 cp_parser_explicit_instantiation
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/parser.cc:19828
0xc2bf00 cp_parser_declaration
        /home/apinski/src/upstream-gcc-match/gcc/gcc/cp/parser.cc:15539
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

```

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

end of thread, other threads:[~2024-03-26  8:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-86862-4@http.gcc.gnu.org/bugzilla/>
2024-03-26  7:39 ` [Bug c++/86862] Segfault using extern template on class deriving from streambuf pinskia at gcc dot gnu.org
2024-03-26  8:15 ` pinskia 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).