public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/106793] New: std::barrier missing default template argument?
@ 2022-08-31 15:35 gonzalo.gadeschi at gmail dot com
  2022-09-01  6:02 ` [Bug libstdc++/106793] " hewillk at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gonzalo.gadeschi at gmail dot com @ 2022-08-31 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106793
           Summary: std::barrier missing default template argument?
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gonzalo.gadeschi at gmail dot com
  Target Milestone: ---

The following example fails:

    #include <barrier>
    void test(std::barrier& b) { b.arrive_and_wait(); }

with the following error when compiled using g++ -std=c++20 and trunk:

<source>:3:11: error: template placeholder type 'barrier<...auto...>' must be
followed by a simple declarator-id
    3 | void test(std::barrier& b) {
      |           ^~~
In file included from <source>:1:
/opt/compiler-explorer/gcc-trunk-20220825/include/c++/13.0.0/barrier:204:11:
note: 'template<class _CompletionF> class std::barrier' declared here
  204 |     class barrier
      |           ^~~~~~~
<source>: In function 'void test(...)'

godbolt: https://gcc.godbolt.org/z/7fE1PGq6o

My reading of the standard, here, http://eel.is/c++draft/thread.barrier#class-6
is that the standard requires barrier to have a default template argument, and
therefore, the above should work.

Is this a bug or am I misunderstanding this?

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

end of thread, other threads:[~2022-09-07 17:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-31 15:35 [Bug libstdc++/106793] New: std::barrier missing default template argument? gonzalo.gadeschi at gmail dot com
2022-09-01  6:02 ` [Bug libstdc++/106793] " hewillk at gmail dot com
2022-09-01  6:42 ` redi at gcc dot gnu.org
2022-09-01 14:07 ` redi at gcc dot gnu.org
2022-09-07 15:27 ` [Bug c++/106793] poor diagnostic for missing template argument list on function parameter jason at gcc dot gnu.org
2022-09-07 17:37 ` cvs-commit at gcc dot gnu.org
2022-09-07 17:38 ` 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).