public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/97874] New: [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652
@ 2020-11-17 10:22 asolokha at gmx dot com
  2020-11-17 15:26 ` [Bug c++/97874] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: asolokha at gmx dot com @ 2020-11-17 10:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97874
           Summary: [11 Regression] ICE: tree check: expected record_type
                    or union_type or qual_union_type, have
                    template_type_parm in lookup_using_decl, at
                    cp/name-lookup.c:4652
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---

g++-11.0.0-alpha20201115 snapshot (g:c746fc40f4ec8cfc1092efd49d567751858d2099)
ICEs when compiling the following testcase, reduced from
test/CXX/dcl.dcl/basic.namespace/namespace.udecl/p8-cxx0x.cpp from the clang
10.0.1 test suite:

template <typename UQ>
void
v4 ()
{
  using UQ::kl;
}

% g++-11.0.0 -c xgk1hrr4.cpp
xgk1hrr4.cpp: In function 'void v4()':
xgk1hrr4.cpp:5:13: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have template_type_parm in lookup_using_decl, at
cp/name-lookup.c:4652
    5 |   using UQ::kl;
      |             ^~
0x7e23fc tree_check_failed(tree_node const*, char const*, int, char const*,
...)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/tree.c:9779
0x65fdb7 tree_check3(tree_node*, char const*, int, char const*, tree_code,
tree_code, tree_code)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/tree.h:3354
0x65fdb7 lookup_using_decl
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/name-lookup.c:4652
0x9b436f finish_nonmember_using_decl(tree_node*, tree_node*)
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/name-lookup.c:5152
0x9bcd74 finish_using_decl
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:20046
0x9f5256 cp_parser_using_declaration
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:20174
0x9f642c cp_parser_declaration_statement
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:13342
0x9db3af cp_parser_statement
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:11588
0x9dc48d cp_parser_statement_seq_opt
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:11954
0x9dc568 cp_parser_compound_statement
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:11904
0x9f65a4 cp_parser_function_body
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:23551
0x9f65a4 cp_parser_ctor_initializer_opt_and_function_body
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:23602
0x9fb049 cp_parser_function_definition_after_declarator
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:29492
0x9fc3e9 cp_parser_function_definition_from_specifiers_and_declarator
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:29408
0x9fc3e9 cp_parser_init_declarator
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:21124
0xa02f5c cp_parser_single_declaration
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:29979
0xa030e5 cp_parser_template_declaration_after_parameters
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:29552
0xa038b0 cp_parser_explicit_template_declaration
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:29817
0xa06429 cp_parser_declaration
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:13589
0xa06d49 cp_parser_translation_unit
       
/var/tmp/portage/sys-devel/gcc-11.0.0_alpha20201115/work/gcc-11-20201115/gcc/cp/parser.c:4806

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

* [Bug c++/97874] [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652
  2020-11-17 10:22 [Bug c++/97874] New: [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652 asolokha at gmx dot com
@ 2020-11-17 15:26 ` rguenth at gcc dot gnu.org
  2020-11-17 15:31 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-11-17 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0

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

* [Bug c++/97874] [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652
  2020-11-17 10:22 [Bug c++/97874] New: [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652 asolokha at gmx dot com
  2020-11-17 15:26 ` [Bug c++/97874] " rguenth at gcc dot gnu.org
@ 2020-11-17 15:31 ` mpolacek at gcc dot gnu.org
  2020-11-17 15:33 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-17 15:31 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-11-17
             Status|UNCONFIRMED                 |NEW

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

* [Bug c++/97874] [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652
  2020-11-17 10:22 [Bug c++/97874] New: [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652 asolokha at gmx dot com
  2020-11-17 15:26 ` [Bug c++/97874] " rguenth at gcc dot gnu.org
  2020-11-17 15:31 ` mpolacek at gcc dot gnu.org
@ 2020-11-17 15:33 ` mpolacek at gcc dot gnu.org
  2021-01-14  9:39 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-11-17 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r11-5003: c++: Implement C++20 'using enum'.

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

* [Bug c++/97874] [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652
  2020-11-17 10:22 [Bug c++/97874] New: [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652 asolokha at gmx dot com
                   ` (2 preceding siblings ...)
  2020-11-17 15:33 ` mpolacek at gcc dot gnu.org
@ 2021-01-14  9:39 ` rguenth at gcc dot gnu.org
  2021-01-26 23:17 ` jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-01-14  9:39 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug c++/97874] [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652
  2020-11-17 10:22 [Bug c++/97874] New: [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652 asolokha at gmx dot com
                   ` (3 preceding siblings ...)
  2021-01-14  9:39 ` rguenth at gcc dot gnu.org
@ 2021-01-26 23:17 ` jason at gcc dot gnu.org
  2021-01-27 20:08 ` cvs-commit at gcc dot gnu.org
  2021-01-27 20:13 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2021-01-26 23:17 UTC (permalink / raw)
  To: gcc-bugs

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

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
             Status|NEW                         |ASSIGNED

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

* [Bug c++/97874] [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652
  2020-11-17 10:22 [Bug c++/97874] New: [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652 asolokha at gmx dot com
                   ` (4 preceding siblings ...)
  2021-01-26 23:17 ` jason at gcc dot gnu.org
@ 2021-01-27 20:08 ` cvs-commit at gcc dot gnu.org
  2021-01-27 20:13 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-01-27 20:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:9cd7c32549fa334885b716fe98b674f6447fa7c0

commit r11-6942-g9cd7c32549fa334885b716fe98b674f6447fa7c0
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jan 27 00:51:01 2021 -0500

    c++: Dependent using enum [PR97874]

    The handling of dependent scopes and unsuitable scopes in lookup_using_decl
    was a bit convoluted; I tweaked it for a while and then eventually
    reorganized much of the function to hopefully be clearer.  Along the way I
    noticed a couple of ways we were mishandling inherited constructors.

    The local binding for a dependent using is the USING_DECL.

    Implement instantiation of a dependent USING_DECL at function scope.

    gcc/cp/ChangeLog:

            PR c++/97874
            * name-lookup.c (lookup_using_decl): Clean up handling
            of dependency and inherited constructors.
            (finish_nonmember_using_decl): Handle DECL_DEPENDENT_P.
            * pt.c (tsubst_expr): Handle DECL_DEPENDENT_P.

    gcc/testsuite/ChangeLog:

            PR c++/97874
            * g++.dg/lookup/using4.C: No error in C++20.
            * g++.dg/cpp0x/decltype37.C: Adjust message.
            * g++.dg/template/crash75.C: Adjust message.
            * g++.dg/template/crash76.C: Adjust message.
            * g++.dg/cpp0x/inh-ctor36.C: New test.
            * g++.dg/cpp1z/inh-ctor39.C: New test.
            * g++.dg/cpp2a/using-enum-7.C: New test.

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

* [Bug c++/97874] [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652
  2020-11-17 10:22 [Bug c++/97874] New: [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652 asolokha at gmx dot com
                   ` (5 preceding siblings ...)
  2021-01-27 20:08 ` cvs-commit at gcc dot gnu.org
@ 2021-01-27 20:13 ` jason at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2021-01-27 20:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-invalid-code         |ice-on-valid-code
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

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

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

end of thread, other threads:[~2021-01-27 20:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17 10:22 [Bug c++/97874] New: [11 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have template_type_parm in lookup_using_decl, at cp/name-lookup.c:4652 asolokha at gmx dot com
2020-11-17 15:26 ` [Bug c++/97874] " rguenth at gcc dot gnu.org
2020-11-17 15:31 ` mpolacek at gcc dot gnu.org
2020-11-17 15:33 ` mpolacek at gcc dot gnu.org
2021-01-14  9:39 ` rguenth at gcc dot gnu.org
2021-01-26 23:17 ` jason at gcc dot gnu.org
2021-01-27 20:08 ` cvs-commit at gcc dot gnu.org
2021-01-27 20:13 ` 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).