public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106052] New: ICE with -Wmismatched-tags with partially specialized friend struct of self type
@ 2022-06-22  4:03 beardsley.matt.j at gmail dot com
  2022-06-22  4:47 ` [Bug c++/106052] " beardsley.matt.j at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: beardsley.matt.j at gmail dot com @ 2022-06-22  4:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106052
           Summary: ICE with -Wmismatched-tags with partially specialized
                    friend struct of self type
           Product: gcc
           Version: 10.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: beardsley.matt.j at gmail dot com
  Target Milestone: ---

The following uses gcc built from a fresh repo that I just cloned earlier today
(default build settings)

tmp.cpp:
    template <typename T1, typename T2>
    struct S {
        template <typename, typename>
        struct S2;

        template <typename Type>
        struct S2<Type, bool> {};

        friend struct S2<S<T1, T2>, bool>;
    };


No ICE with warning off:
$ g++ -c tmp.cpp -o /dev/null -Wno-mismatched-tags
(no output)

ICE with warning on:
$ g++ -c tmp.cpp -o /dev/null -Wmismatched-tags
tmp.cpp: In substitution of ‘template<class Type> struct S<T1, T2>::S2<Type,
bool> [with Type = S<T1, T2>]’:
tmp.cpp:10:2:   required from here
tmp.cpp:10:2: internal compiler error: tree check: accessed elt 2 of ‘tree_vec’
with 1 elts in tsubst, at cp/pt.cc:15831
   10 | };
      |  ^
0x8ae378 tree_vec_elt_check_failed(int, int, char const*, int, char const*)
        ../.././gcc/tree.cc:9016
0x9d5d11 tree_vec_elt_check(tree_node*, int, char const*, int, char const*)
        ../.././gcc/tree.h:3737
0xb71967 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../.././gcc/cp/pt.cc:15831
0xb7ff0e tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ../.././gcc/cp/pt.cc:13580
0xb80132 tsubst_template_args(tree_node*, tree_node*, int, tree_node*)
        ../.././gcc/cp/pt.cc:13562
0xb6eca7 get_partial_spec_bindings
        ../.././gcc/cp/pt.cc:25457
0xb6f15b most_specialized_partial_spec(tree_node*, int)
        ../.././gcc/cp/pt.cc:25703
0xaf2970 specialization_of
        ../.././gcc/cp/parser.cc:33627
0xaf2970 class_decl_loc_t::diag_mismatched_tags(tree_node*)
        ../.././gcc/cp/parser.cc:33811
0xaf8db8 class_decl_loc_t::diag_mismatched_tags()
        ../.././gcc/cp/parser.cc:33935
0xb3c292 c_parse_file()
        ../.././gcc/cp/parser.cc:48376
0xc721d1 c_common_parse_file()
        ../.././gcc/c-family/c-opts.cc:1235
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] 4+ messages in thread

end of thread, other threads:[~2024-01-31 15:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-22  4:03 [Bug c++/106052] New: ICE with -Wmismatched-tags with partially specialized friend struct of self type beardsley.matt.j at gmail dot com
2022-06-22  4:47 ` [Bug c++/106052] " beardsley.matt.j at gmail dot com
2022-06-22 11:05 ` redi at gcc dot gnu.org
2024-01-31 15:14 ` 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).