public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107111] New: GCC accepts invalid program involving function declaration with pack expansion
@ 2022-10-01 17:05 jlame646 at gmail dot com
  2022-10-01 17:11 ` [Bug c++/107111] " jlame646 at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: jlame646 at gmail dot com @ 2022-10-01 17:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107111
           Summary: GCC accepts invalid program involving function
                    declaration with pack expansion
           Product: gcc
           Version: 12.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

The following program is incorrectly accepted by gcc. Demo:
https://godbolt.org/z/rvfqzo5YW

```
template<typename T, typename... V> 
struct C 
{
    T v(V()...);;
};
int main()
{

    C<int> c; //works with gcc but rejected in clang 
    C<int, double, int, int> c2; //same here: works with gcc but rejected in
clang
}
```
This is invalid because the construct `V()...` is actually equivalent to
`V(),...`. So `V` is not expanded and this must be rejected.

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

end of thread, other threads:[~2022-10-02  9:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-01 17:05 [Bug c++/107111] New: GCC accepts invalid program involving function declaration with pack expansion jlame646 at gmail dot com
2022-10-01 17:11 ` [Bug c++/107111] " jlame646 at gmail dot com
2022-10-01 17:24 ` jlame646 at gmail dot com
2022-10-02  4:34 ` iamsupermouse at mail dot ru
2022-10-02  4:35 ` iamsupermouse at mail dot ru
2022-10-02  9:47 ` jlame646 at gmail dot com

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