public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99285] New: [modules] ICE canonical types differ for identical types ‘std::common_type...
@ 2021-02-26  8:56 alexander.lelyakin at googlemail dot com
  2021-03-05 21:51 ` [Bug c++/99285] " nathan at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: alexander.lelyakin at googlemail dot com @ 2021-02-26  8:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99285
           Summary: [modules] ICE canonical types differ for identical
                    types ‘std::common_type...
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexander.lelyakin at googlemail dot com
  Target Milestone: ---

g++ -std=c++20 -fmodules-ts -x c++-system-header atomic
g++ -std=c++20 -fmodules-ts -x c++-system-header locale
g++ -std=c++20 -fmodules-ts -x c++-system-header stop_token
----
In file included from
/usr/local/include/c++/11.0.1/bits/atomic_timed_wait.h:40,
                 from /usr/local/include/c++/11.0.1/bits/semaphore_base.h:37,
                 from /usr/local/include/c++/11.0.1/semaphore:35,
                 from /usr/local/include/c++/11.0.1/stop_token:37:
/usr/local/include/c++/11.0.1/chrono:665:64: internal compiler error: canonical
types differ for identical types ‘std::common_type<_Rep1, _Rep2>’ and
‘std::common_type<_Tp1, _Tp2>’
  665 |              typename _CRep = typename common_type<_Rep1, _Rep2>::type>
      |                                                                ^
0xb7c74f comptypes(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/typeck.c:1540
0xb473b2 fixup_template_type
        ../../gcc/gcc/cp/semantics.c:3477
0xb473b2 finish_template_type(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/semantics.c:3510
0xab96c1 cp_parser_template_id
        ../../gcc/gcc/cp/parser.c:17397
0xab98ab cp_parser_class_name
        ../../gcc/gcc/cp/parser.c:24624
0xab0e3a cp_parser_qualifying_entity
        ../../gcc/gcc/cp/parser.c:6994
0xab0e3a cp_parser_nested_name_specifier_opt
        ../../gcc/gcc/cp/parser.c:6676
0xabfc5f cp_parser_nested_name_specifier
        ../../gcc/gcc/cp/parser.c:6920
0xabfc5f cp_parser_elaborated_type_specifier
        ../../gcc/gcc/cp/parser.c:19372
0xaa5395 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:18398
0xab70f3 cp_parser_type_specifier_seq
        ../../gcc/gcc/cp/parser.c:23299
0xab5774 cp_parser_type_id_1
        ../../gcc/gcc/cp/parser.c:23102
0xab5a04 cp_parser_type_id
        ../../gcc/gcc/cp/parser.c:23195
0xab5a04 cp_parser_default_type_template_argument
        ../../gcc/gcc/cp/parser.c:16843
0xac350f cp_parser_type_parameter
        ../../gcc/gcc/cp/parser.c:17079
0xac27af cp_parser_template_parameter
        ../../gcc/gcc/cp/parser.c:16930
0xac27af cp_parser_template_parameter_list
        ../../gcc/gcc/cp/parser.c:16563
0xad17f2 cp_parser_explicit_template_declaration
        ../../gcc/gcc/cp/parser.c:30257
0xad3fd9 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:14000
0xad3579 cp_parser_toplevel_declaration
        ../../gcc/gcc/cp/parser.c:14098
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
----
g++ (GCC) 11.0.1 20210225 (experimental)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

* [Bug c++/99285] [modules] ICE canonical types differ for identical types ‘std::common_type...
  2021-02-26  8:56 [Bug c++/99285] New: [modules] ICE canonical types differ for identical types ‘std::common_type alexander.lelyakin at googlemail dot com
@ 2021-03-05 21:51 ` nathan at gcc dot gnu.org
  2021-03-08 18:08 ` cvs-commit at gcc dot gnu.org
  2021-03-08 18:09 ` nathan at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-03-05 21:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
//bug_a.ii
template<typename... _Tp> struct common_type;

template<> struct common_type<> {};

template<typename _Tp0> struct common_type<_Tp0> {};

template<typename _Tp1, typename _Tp2> struct common_type<_Tp1, _Tp2> {};

//bug_b.ii
import  "bug_a.ii";

template<typename _Rep1, typename _Rep2,
         typename _CRep = typename common_type<_Rep1, _Rep2>::type>
struct X;

./cc1plus -quiet -std=c++20 -fmodule-header bug_a.ii && ./cc1plus -quiet
-std=c++20 -fmodule-header bug_b.ii  
bug_b.ii:4:60: internal compiler error: canonical types differ for identical
types 'common_type<_Rep1, _Rep2>' and 'common_type<_Tp1, _Tp2>'
    4 |          typename _CRep = typename common_type<_Rep1, _Rep2>::type>
      |                                                            ^
0xea4ed7 comptypes(tree_node*, tree_node*, int)
        ../../../src/gcc/cp/typeck.c:1547
0xe4beea fixup_template_type
        ../../../src/gcc/cp/semantics.c:3477
0xe4c1f6 finish_template_type(tree_node*, tree_node*, int)
        ../../../src/gcc/cp/semantics.c:3510
0xd4aa7b cp_parser_template_id
        ../../../src/gcc/cp/parser.c:17444
0xd59426 cp_parser_class_name
        ../../../src/gcc/cp/parser.c:24671
0xd34ebf cp_parser_qualifying_entity
        ../../../src/gcc/cp/parser.c:6994

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

* [Bug c++/99285] [modules] ICE canonical types differ for identical types ‘std::common_type...
  2021-02-26  8:56 [Bug c++/99285] New: [modules] ICE canonical types differ for identical types ‘std::common_type alexander.lelyakin at googlemail dot com
  2021-03-05 21:51 ` [Bug c++/99285] " nathan at gcc dot gnu.org
@ 2021-03-08 18:08 ` cvs-commit at gcc dot gnu.org
  2021-03-08 18:09 ` nathan at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-08 18:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Nathan Sidwell <nathan@gcc.gnu.org>:

https://gcc.gnu.org/g:ded6a1953dd7f43229c44e5d0d17c264338a3f4c

commit r11-7557-gded6a1953dd7f43229c44e5d0d17c264338a3f4c
Author: Nathan Sidwell <nathan@acm.org>
Date:   Mon Mar 8 10:01:21 2021 -0800

    c++: Incorrect specialization hash table [PR 99285]

    Class template partial specializations need to be in the
    specialization hash, but not all of them.  This defers adding
    streamed-in entities to the hash table, in the same way I deferred
    adding the instantiation and specialization lists for 99170.

            PR c++/99285
            gcc/cp/
            * cp-tree.h (match_mergeable_specialization)
            (add_mergeable_specialization): Adjust parms.
            * module.cc (trees_in::decl_value): Adjust
            add_mergeable_specialization calls.
            (trees_out::key_mergeable): Adjust match_mergeable_specialization
            calls.
            (specialization_add): Likewise.
            * pt.c (match_mergeable_specialization): Do not insert.
            (add_mergeable_specialization): Add to hash table here.
            gcc/testsuite/
            * g++.dg/modules/pr99285_a.H: New.
            * g++.dg/modules/pr99285_b.H: New.

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

* [Bug c++/99285] [modules] ICE canonical types differ for identical types ‘std::common_type...
  2021-02-26  8:56 [Bug c++/99285] New: [modules] ICE canonical types differ for identical types ‘std::common_type alexander.lelyakin at googlemail dot com
  2021-03-05 21:51 ` [Bug c++/99285] " nathan at gcc dot gnu.org
  2021-03-08 18:08 ` cvs-commit at gcc dot gnu.org
@ 2021-03-08 18:09 ` nathan at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: nathan at gcc dot gnu.org @ 2021-03-08 18:09 UTC (permalink / raw)
  To: gcc-bugs

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

Nathan Sidwell <nathan at gcc dot gnu.org> changed:

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

--- Comment #3 from Nathan Sidwell <nathan at gcc dot gnu.org> ---
ded6a1953dd 2021-03-08 | c++: Incorrect specialization hash table [PR 99285]

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

end of thread, other threads:[~2021-03-08 18:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26  8:56 [Bug c++/99285] New: [modules] ICE canonical types differ for identical types ‘std::common_type alexander.lelyakin at googlemail dot com
2021-03-05 21:51 ` [Bug c++/99285] " nathan at gcc dot gnu.org
2021-03-08 18:08 ` cvs-commit at gcc dot gnu.org
2021-03-08 18:09 ` nathan 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).