public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104235] New: [12 Regression] ICE: in cp_parser_template_id,  at cp/parser.cc
@ 2022-01-26  0:20 glisse at gcc dot gnu.org
  2022-01-26  0:22 ` [Bug c++/104235] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: glisse at gcc dot gnu.org @ 2022-01-26  0:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104235
           Summary: [12 Regression] ICE: in cp_parser_template_id, at
                    cp/parser.cc
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org
  Target Milestone: ---

template <class M>
struct L: M {
  using M::a;
  void p() { this->template a<>; }
};

(accepted by g++-11 and clang++-13)

bug.cc: In member function 'void L<M>::p()':
bug.cc:4:31: internal compiler error: in cp_parser_template_id, at
cp/parser.cc:18367
    4 |   void p() { this->template a<>; }
      |                               ^
0x719e9c cp_parser_template_id
        ../../src/gcc/cp/parser.cc:18367
0xfa5beb cp_parser_class_name
        ../../src/gcc/cp/parser.cc:25694
0xf9bddb cp_parser_qualifying_entity
        ../../src/gcc/cp/parser.cc:7118
0xf9bddb cp_parser_nested_name_specifier_opt
        ../../src/gcc/cp/parser.cc:6800
0xf9da5a cp_parser_id_expression
        ../../src/gcc/cp/parser.cc:6148
0xfa63cf cp_parser_postfix_dot_deref_expression
        ../../src/gcc/cp/parser.cc:8305
0xf9a103 cp_parser_postfix_expression
        ../../src/gcc/cp/parser.cc:7904
0xf81eea cp_parser_binary_expression
        ../../src/gcc/cp/parser.cc:10041
0xf82a4e cp_parser_assignment_expression
        ../../src/gcc/cp/parser.cc:10345
0xf84579 cp_parser_expression
        ../../src/gcc/cp/parser.cc:10515
0xf87b97 cp_parser_expression_statement
        ../../src/gcc/cp/parser.cc:12711
0xf950b7 cp_parser_statement
        ../../src/gcc/cp/parser.cc:12507
0xf9619d cp_parser_statement_seq_opt
        ../../src/gcc/cp/parser.cc:12856
0xf96277 cp_parser_compound_statement
        ../../src/gcc/cp/parser.cc:12808
0xfb6565 cp_parser_function_body
        ../../src/gcc/cp/parser.cc:25052
0xfb6565 cp_parser_ctor_initializer_opt_and_function_body
        ../../src/gcc/cp/parser.cc:25103
0xfb746e cp_parser_function_definition_after_declarator
        ../../src/gcc/cp/parser.cc:31229
0xfb791c cp_parser_late_parsing_for_member
        ../../src/gcc/cp/parser.cc:32150
0xf8fb2a cp_parser_class_specifier_1
        ../../src/gcc/cp/parser.cc:26170
0xf90b72 cp_parser_class_specifier
        ../../src/gcc/cp/parser.cc:26194

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

* [Bug c++/104235] [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc
  2022-01-26  0:20 [Bug c++/104235] New: [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc glisse at gcc dot gnu.org
@ 2022-01-26  0:22 ` pinskia at gcc dot gnu.org
  2022-01-26  0:26 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-26  0:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

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

* [Bug c++/104235] [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc
  2022-01-26  0:20 [Bug c++/104235] New: [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc glisse at gcc dot gnu.org
  2022-01-26  0:22 ` [Bug c++/104235] " pinskia at gcc dot gnu.org
@ 2022-01-26  0:26 ` mpolacek at gcc dot gnu.org
  2022-01-26  0:59 ` mpolacek at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-01-26  0:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Keywords|needs-bisection             |
                 CC|                            |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2022-01-26
           Priority|P3                          |P1
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
commit 30f2c22def7392119f1ffaca30ef998b3b43f336
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Jan 18 18:28:22 2022 -0500

    c++: template-id with current inst qualifier [PR102300]

    The patch for PR41723 properly changed one place to look into the current
    instantiation; now we need to fix this place as well.

            PR c++/102300

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_template_name): Use dependent_scope_p.

    gcc/testsuite/ChangeLog:

            * g++.dg/parse/no-typename1.C: Remove expected error.
            * g++.dg/template/nested7.C: New test.

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

* [Bug c++/104235] [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc
  2022-01-26  0:20 [Bug c++/104235] New: [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc glisse at gcc dot gnu.org
  2022-01-26  0:22 ` [Bug c++/104235] " pinskia at gcc dot gnu.org
  2022-01-26  0:26 ` mpolacek at gcc dot gnu.org
@ 2022-01-26  0:59 ` mpolacek at gcc dot gnu.org
  2022-01-26 15:30 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-01-26  0:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I guess we want

--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -18574,7 +18574,7 @@ cp_parser_template_name (cp_parser* parser,
            : parser->context->object_type);
      if (scope && TYPE_P (scope)
          && (!CLASS_TYPE_P (scope)
-         || (check_dependency_p && dependent_scope_p (scope))))
+         || (check_dependency_p && dependentish_scope_p (scope))))
        {
          /* We're optimizing away the call to cp_parser_lookup_name, but
         we still need to do this.  */

because the scope here (L<M>) has dependent bases.

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

* [Bug c++/104235] [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc
  2022-01-26  0:20 [Bug c++/104235] New: [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc glisse at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-01-26  0:59 ` mpolacek at gcc dot gnu.org
@ 2022-01-26 15:30 ` jason at gcc dot gnu.org
  2022-01-26 16:39 ` cvs-commit at gcc dot gnu.org
  2022-01-26 16:40 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2022-01-26 15:30 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

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

* [Bug c++/104235] [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc
  2022-01-26  0:20 [Bug c++/104235] New: [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc glisse at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-01-26 15:30 ` jason at gcc dot gnu.org
@ 2022-01-26 16:39 ` cvs-commit at gcc dot gnu.org
  2022-01-26 16:40 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-26 16:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:00d8321124123daf41f7c51526355a5a610cdeb8

commit r12-6879-g00d8321124123daf41f7c51526355a5a610cdeb8
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jan 26 10:40:42 2022 -0500

    c++: ->template and using-decl [PR104235]

    cp_parser_template_id wasn't prepared to handle getting a USING_DECL back
    from cp_parser_template_name.  Let's defer that case to instantiation time,
    as well.

            PR c++/104235

    gcc/cp/ChangeLog:

            * parser.cc (cp_parser_template_name): Repeat lookup of USING_DECL.

    gcc/testsuite/ChangeLog:

            * g++.dg/parse/template-keyword2.C: New test.

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

* [Bug c++/104235] [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc
  2022-01-26  0:20 [Bug c++/104235] New: [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc glisse at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-01-26 16:39 ` cvs-commit at gcc dot gnu.org
@ 2022-01-26 16:40 ` jason at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu.org @ 2022-01-26 16:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed

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

end of thread, other threads:[~2022-01-26 16:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26  0:20 [Bug c++/104235] New: [12 Regression] ICE: in cp_parser_template_id, at cp/parser.cc glisse at gcc dot gnu.org
2022-01-26  0:22 ` [Bug c++/104235] " pinskia at gcc dot gnu.org
2022-01-26  0:26 ` mpolacek at gcc dot gnu.org
2022-01-26  0:59 ` mpolacek at gcc dot gnu.org
2022-01-26 15:30 ` jason at gcc dot gnu.org
2022-01-26 16:39 ` cvs-commit at gcc dot gnu.org
2022-01-26 16:40 ` 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).