public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/96922] New: primary expression error when using parenthesis around requires expression for some concepts
@ 2020-09-03 13:46 rene.rahn@fu-berlin.de
  2020-09-03 13:47 ` [Bug libstdc++/96922] " rene.rahn@fu-berlin.de
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rene.rahn@fu-berlin.de @ 2020-09-03 13:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96922
           Summary: primary expression error when using parenthesis around
                    requires expression for some concepts
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rene.rahn@fu-berlin.de
  Target Milestone: ---

Hi GCC team, 

I found a strange behavior when using c++17 mode with -fconcepts on gcc 10 as
well as gcc 9. Basically, if we use a concept that uses variadic templates then
the compiler emits a primary expression error when putting parenthesis around
the requires expression. This does not happen if we leave the parenthesis away
or if the concept does not use variadic templates.

Here the example I ran into (https://godbolt.org/z/95d4Y3):
```cpp
#include <type_traits>

// Not working for concepts with variadic templates
template <typename t, typename ...args_t>
concept constructible_from = std::is_constructible_v<t, args_t...>;

template <typename t>
    requires (constructible_from<t>) // does not work with parenthesis
void foo();

template <typename t>
    requires constructible_from<t> // works without parenthesis
void bar();

// Working without variadic templates
template <typename t, typename u>
concept constructible_from_one = std::is_constructible_v<t, u>;

template <typename t>
    requires (constructible_from_one<t, t>) 
void foo();

```

Thank you very much for your help.

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

end of thread, other threads:[~2020-09-03 19:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 13:46 [Bug libstdc++/96922] New: primary expression error when using parenthesis around requires expression for some concepts rene.rahn@fu-berlin.de
2020-09-03 13:47 ` [Bug libstdc++/96922] " rene.rahn@fu-berlin.de
2020-09-03 14:31 ` [Bug c++/96922] " redi at gcc dot gnu.org
2020-09-03 16:05 ` [Bug libstdc++/96922] " rene.rahn@fu-berlin.de
2020-09-03 19:30 ` [Bug c++/96922] " redi 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).