public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106629] New: GCC accepts invalid program involving {1,2,3,4} as template argument
@ 2022-08-15 16:05 jlame646 at gmail dot com
  2022-08-15 16:20 ` [Bug c++/106629] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jlame646 at gmail dot com @ 2022-08-15 16:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106629
           Summary: GCC accepts invalid program involving {1,2,3,4} as
                    template argument
           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 invalid program is accepted by gcc.
https://godbolt.org/z/Mb3qbvvPz 

```
struct Impl
{
  constexpr Impl(std::initializer_list<int>)
  {

  }
};
struct Bar{};
template<typename T, Impl impl>
struct Foo
{

};
int main()
{
    constexpr Foo<Bar, {1,2,3,4}> foo; //works in msvc & gcc but rejected in
clang
    return 0;
}
```

The program is invalid because `{1,2,3,4}` cannot be a template argument.

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

end of thread, other threads:[~2022-08-15 16:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-15 16:05 [Bug c++/106629] New: GCC accepts invalid program involving {1,2,3,4} as template argument jlame646 at gmail dot com
2022-08-15 16:20 ` [Bug c++/106629] " pinskia at gcc dot gnu.org
2022-08-15 16:33 ` pinskia at gcc dot gnu.org
2022-08-15 16:35 ` mpolacek at gcc dot gnu.org
2022-08-15 16:49 ` pinskia 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).