public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101095] New: Bogus "error: conflicting global module declaration" for abbreviate function template using placeholder type in noexcept
@ 2021-06-16 12:36 redi at gcc dot gnu.org
  2021-06-16 15:24 ` [Bug c++/101095] Bogus "error: conflicting global module declaration" for abbreviated " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2021-06-16 12:36 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101095
           Summary: Bogus "error: conflicting global module declaration"
                    for abbreviate function template using placeholder
                    type in noexcept
           Product: gcc
           Version: 11.1.1
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

cat > mod.h <<EOT
#ifndef MOD_H
#define MOD_H
template<typename T> concept rhubarb = true;
template<typename T> constexpr bool nothrow = true;
void donkey(rhubarb auto i) noexcept(nothrow<decltype(i)>) { }
#endif
EOT

cat > mod.H <<EOT
#include "mod.h"
EOT

cat > mod.C <<EOT
#include "mod.h"
import "mod.H";

int main()
{
  donkey(1);
}
EOT

g++ -std=c++20 -fmodule-header mod.H -c
g++ -std=c++20 -fmodules-ts mod.C

This gives a bogus error:

In file included from mod.H:1,
of module ./mod.H, imported at mod.C:2:
mod.h: In function ‘int main()’:
mod.h:5:6: error: conflicting global module declaration ‘template<class auto:1>
void donkey(auto:1)’
    5 | void donkey(rhubarb auto i) noexcept(nothrow<decltype(i)>) { }
      |      ^~~~~~
In file included from mod.C:1:
mod.h:5:6: note: existing declaration ‘template<class auto:1>  requires 
rhubarb<auto:1> void donkey(auto:1)’
    5 | void donkey(rhubarb auto i) noexcept(nothrow<decltype(i)>) { }
      |      ^~~~~~
mod.C:6:3: note: during load of binding ‘::donkey’
    6 |   donkey(1);
      |   ^~~~~~


The code compiles OK if the noexcept-specifier doesn't refer to the auto:1
type.

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

* [Bug c++/101095] Bogus "error: conflicting global module declaration" for abbreviated function template using placeholder type in noexcept
  2021-06-16 12:36 [Bug c++/101095] New: Bogus "error: conflicting global module declaration" for abbreviate function template using placeholder type in noexcept redi at gcc dot gnu.org
@ 2021-06-16 15:24 ` redi at gcc dot gnu.org
  2021-07-14 21:20 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: redi at gcc dot gnu.org @ 2021-06-16 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-06-16
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
This causes:

FAIL: g++.dg/modules/xtreme-header-2_b.C -std=c++2a (test for excess errors)
FAIL: g++.dg/modules/xtreme-header-2_b.C -std=c++2b (test for excess errors)
FAIL: g++.dg/modules/xtreme-tr1_b.C -std=c++2a (test for excess errors)
FAIL: g++.dg/modules/xtreme-tr1_b.C -std=c++2b (test for excess errors)

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

* [Bug c++/101095] Bogus "error: conflicting global module declaration" for abbreviated function template using placeholder type in noexcept
  2021-06-16 12:36 [Bug c++/101095] New: Bogus "error: conflicting global module declaration" for abbreviate function template using placeholder type in noexcept redi at gcc dot gnu.org
  2021-06-16 15:24 ` [Bug c++/101095] Bogus "error: conflicting global module declaration" for abbreviated " redi at gcc dot gnu.org
@ 2021-07-14 21:20 ` jason at gcc dot gnu.org
  2021-07-15  3:18 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2021-07-14 21:20 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/101095] Bogus "error: conflicting global module declaration" for abbreviated function template using placeholder type in noexcept
  2021-06-16 12:36 [Bug c++/101095] New: Bogus "error: conflicting global module declaration" for abbreviate function template using placeholder type in noexcept redi at gcc dot gnu.org
  2021-06-16 15:24 ` [Bug c++/101095] Bogus "error: conflicting global module declaration" for abbreviated " redi at gcc dot gnu.org
  2021-07-14 21:20 ` jason at gcc dot gnu.org
@ 2021-07-15  3:18 ` cvs-commit at gcc dot gnu.org
  2022-03-22  5:18 ` cvs-commit at gcc dot gnu.org
  2022-10-20 16:45 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-15  3:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:0b7a11874d4eb428c18a91f38786032ce0e77a96

commit r12-2313-g0b7a11874d4eb428c18a91f38786032ce0e77a96
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jul 14 17:10:49 2021 -0400

    c++: fix tree_contains_struct for C++ types [PR101095]

    Many of the types from cp-tree.def were only marked as having tree_common,
    when actually most of them have type_non_common.  This broke
    g++.dg/modules/xtreme-header-2, as the modules code relies on
    tree_contains_struct to know what bits it needs to stream.

    We don't seem to use type_non_common for TYPE_ARGUMENT_PACK, so I bumped it
    down to TS_TYPE_COMMON.  I tried doing the same in cp_tree_size, but that
    breaks without more extensive changes to tree_node_structure.

    Why do we need the init_ts function anyway?  It seems redundant with
    tree_node_structure.

            PR c++/101095

    gcc/cp/ChangeLog:

            * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
            (cp_tree_size): Remove redundant entries.

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

* [Bug c++/101095] Bogus "error: conflicting global module declaration" for abbreviated function template using placeholder type in noexcept
  2021-06-16 12:36 [Bug c++/101095] New: Bogus "error: conflicting global module declaration" for abbreviate function template using placeholder type in noexcept redi at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-07-15  3:18 ` cvs-commit at gcc dot gnu.org
@ 2022-03-22  5:18 ` cvs-commit at gcc dot gnu.org
  2022-10-20 16:45 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-03-22  5:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:0a63e3ee2d5c9aa0e51aa1eb54c3d14c06418ac3

commit r11-9680-g0a63e3ee2d5c9aa0e51aa1eb54c3d14c06418ac3
Author: Jason Merrill <jason@redhat.com>
Date:   Wed Jul 14 17:10:49 2021 -0400

    c++: fix tree_contains_struct for C++ types [PR101095]

    Many of the types from cp-tree.def were only marked as having tree_common,
    when actually most of them have type_non_common.  This broke
    g++.dg/modules/xtreme-header-2, as the modules code relies on
    tree_contains_struct to know what bits it needs to stream.

    We don't seem to use type_non_common for TYPE_ARGUMENT_PACK, so I bumped it
    down to TS_TYPE_COMMON.  I tried doing the same in cp_tree_size, but that
    breaks without more extensive changes to tree_node_structure.

    Why do we need the init_ts function anyway?  It seems redundant with
    tree_node_structure.

            PR c++/101095

    gcc/cp/ChangeLog:

            * cp-objcp-common.c (cp_common_init_ts): Mark types as types.
            (cp_tree_size): Remove redundant entries.

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

* [Bug c++/101095] Bogus "error: conflicting global module declaration" for abbreviated function template using placeholder type in noexcept
  2021-06-16 12:36 [Bug c++/101095] New: Bogus "error: conflicting global module declaration" for abbreviate function template using placeholder type in noexcept redi at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-03-22  5:18 ` cvs-commit at gcc dot gnu.org
@ 2022-10-20 16:45 ` ppalka at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-10-20 16:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
   Target Milestone|---                         |11.3
         Resolution|---                         |FIXED

--- Comment #4 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed for GCC 11.3+ I suppose

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

end of thread, other threads:[~2022-10-20 16:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 12:36 [Bug c++/101095] New: Bogus "error: conflicting global module declaration" for abbreviate function template using placeholder type in noexcept redi at gcc dot gnu.org
2021-06-16 15:24 ` [Bug c++/101095] Bogus "error: conflicting global module declaration" for abbreviated " redi at gcc dot gnu.org
2021-07-14 21:20 ` jason at gcc dot gnu.org
2021-07-15  3:18 ` cvs-commit at gcc dot gnu.org
2022-03-22  5:18 ` cvs-commit at gcc dot gnu.org
2022-10-20 16:45 ` 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).