public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/109655] New: Prior friend declaration causes "confused by earlier errors, bailing out" with missing constraint on out-of-class class template member definition
@ 2023-04-27 21:33 rs2740 at gmail dot com
  2023-04-27 21:40 ` [Bug c++/109655] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rs2740 at gmail dot com @ 2023-04-27 21:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109655
           Summary: Prior friend declaration causes "confused by earlier
                    errors, bailing out" with missing constraint on
                    out-of-class class template member definition
           Product: gcc
           Version: 13.1.0
               URL: https://gcc.godbolt.org/z/dvTbz8vcj
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rs2740 at gmail dot com
  Target Milestone: ---

class C
{
    template <class>
    requires true
    friend class D;
};

template <class>
requires true
class D {
    void f();
};

template<class T>  // missing "requires true"
void D<T>::f()
{
}

With gcc 13.1, g++ -std=c++20 (or c++2b) produces

'
<source>:15: confused by earlier errors, bailing out

Removing the in-class friend declaration produces a proper error message:

<source>:12:14: error: redeclaration of 'template<class>  requires  true class
D' with different constraints
   12 | void D<T>::f()
      |

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

* [Bug c++/109655] Prior friend declaration causes "confused by earlier errors, bailing out" with missing constraint on out-of-class class template member definition
  2023-04-27 21:33 [Bug c++/109655] New: Prior friend declaration causes "confused by earlier errors, bailing out" with missing constraint on out-of-class class template member definition rs2740 at gmail dot com
@ 2023-04-27 21:40 ` pinskia at gcc dot gnu.org
  2023-04-27 21:43 ` [Bug c++/109655] Prior friend declaration causes "confused by earlier errors, bailing out" (with no error message) " pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-27 21:40 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|https://gcc.godbolt.org/z/d |
                   |vTbz8vcj                    |

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
https://gcc.godbolt.org/z/dvTbz8vcj

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

* [Bug c++/109655] Prior friend declaration causes "confused by earlier errors, bailing out" (with no error message) with missing constraint on out-of-class class template member definition
  2023-04-27 21:33 [Bug c++/109655] New: Prior friend declaration causes "confused by earlier errors, bailing out" with missing constraint on out-of-class class template member definition rs2740 at gmail dot com
  2023-04-27 21:40 ` [Bug c++/109655] " pinskia at gcc dot gnu.org
@ 2023-04-27 21:43 ` pinskia at gcc dot gnu.org
  2023-04-27 21:44 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-27 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Here is the full backtrace for the trunk:
‘
Segmentation fault
   15 | void D<T>::f()
      |              ^
0x125eddf crash_signal
        /home/apinski/src/upstream-gcc-git/gcc/gcc/toplev.cc:314
0x7f4dc2a54def ???
       
/usr/src/debug/glibc-2.34-60.el9.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0
0xacf71d cp_printer
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/error.cc:4471
0x223f58f pp_format(pretty_printer*, text_info*)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/pretty-print.cc:1475
0x221dd9e diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/diagnostic.cc:1592
0x221e4f1 diagnostic_impl
        /home/apinski/src/upstream-gcc-git/gcc/gcc/diagnostic.cc:1756
0x221ed46 error(char const*, ...)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/diagnostic.cc:2052
0xc0822c push_template_decl(tree_node*, bool)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/pt.cc:6159
0xa8db1c start_preparsed_function(tree_node*, tree_node*, int)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/decl.cc:17371
0xaa257e start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/decl.cc:17708
0xbaabdf cp_parser_function_definition_from_specifiers_and_declarator
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:31923
0xbaabdf cp_parser_init_declarator
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:22822
0xbb23b6 cp_parser_single_declaration
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:32563
0xbb257c cp_parser_template_declaration_after_parameters
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:32116
0xbb2e70 cp_parser_explicit_template_declaration
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:32389
0xbb59a5 cp_parser_declaration
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:15050
0xbb63ca cp_parser_toplevel_declaration
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:15142
0xbb63ca cp_parser_translation_unit
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:5131
0xbb63ca c_parse_file()
        /home/apinski/src/upstream-gcc-git/gcc/gcc/cp/parser.cc:49627
0xcf4b31 c_common_parse_file()
        /home/apinski/src/upstream-gcc-git/gcc/gcc/c-family/c-opts.cc:1248
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] 6+ messages in thread

* [Bug c++/109655] Prior friend declaration causes "confused by earlier errors, bailing out" (with no error message) with missing constraint on out-of-class class template member definition
  2023-04-27 21:33 [Bug c++/109655] New: Prior friend declaration causes "confused by earlier errors, bailing out" with missing constraint on out-of-class class template member definition rs2740 at gmail dot com
  2023-04-27 21:40 ` [Bug c++/109655] " pinskia at gcc dot gnu.org
  2023-04-27 21:43 ` [Bug c++/109655] Prior friend declaration causes "confused by earlier errors, bailing out" (with no error message) " pinskia at gcc dot gnu.org
@ 2023-04-27 21:44 ` pinskia at gcc dot gnu.org
  2023-04-27 21:44 ` pinskia at gcc dot gnu.org
  2023-06-07 14:01 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-27 21:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
                  error ("redeclaration of %qD with different constraints",
                         TPARMS_PRIMARY_TEMPLATE (TREE_VALUE (decl_parms)));
                  break;


Looks like it is trying to print out the decl here but ICEing.

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

* [Bug c++/109655] Prior friend declaration causes "confused by earlier errors, bailing out" (with no error message) with missing constraint on out-of-class class template member definition
  2023-04-27 21:33 [Bug c++/109655] New: Prior friend declaration causes "confused by earlier errors, bailing out" with missing constraint on out-of-class class template member definition rs2740 at gmail dot com
                   ` (2 preceding siblings ...)
  2023-04-27 21:44 ` pinskia at gcc dot gnu.org
@ 2023-04-27 21:44 ` pinskia at gcc dot gnu.org
  2023-06-07 14:01 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-04-27 21:44 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-04-27

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug c++/109655] Prior friend declaration causes "confused by earlier errors, bailing out" (with no error message) with missing constraint on out-of-class class template member definition
  2023-04-27 21:33 [Bug c++/109655] New: Prior friend declaration causes "confused by earlier errors, bailing out" with missing constraint on out-of-class class template member definition rs2740 at gmail dot com
                   ` (3 preceding siblings ...)
  2023-04-27 21:44 ` pinskia at gcc dot gnu.org
@ 2023-06-07 14:01 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-06-07 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ppalka at gcc dot gnu.org
                 CC|                            |ppalka at gcc dot gnu.org

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

end of thread, other threads:[~2023-06-07 14:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-27 21:33 [Bug c++/109655] New: Prior friend declaration causes "confused by earlier errors, bailing out" with missing constraint on out-of-class class template member definition rs2740 at gmail dot com
2023-04-27 21:40 ` [Bug c++/109655] " pinskia at gcc dot gnu.org
2023-04-27 21:43 ` [Bug c++/109655] Prior friend declaration causes "confused by earlier errors, bailing out" (with no error message) " pinskia at gcc dot gnu.org
2023-04-27 21:44 ` pinskia at gcc dot gnu.org
2023-04-27 21:44 ` pinskia at gcc dot gnu.org
2023-06-07 14:01 ` ppalka 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).