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

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).