public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/108234] New: GCC accepts invalid program involving nontype template parameter of auto with non constexpr variable
@ 2022-12-27 13:54 jlame646 at gmail dot com
  2022-12-28 19:22 ` [Bug c++/108234] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jlame646 at gmail dot com @ 2022-12-27 13:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108234
           Summary: GCC accepts invalid program involving nontype template
                    parameter of auto with non constexpr variable
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jlame646 at gmail dot com
  Target Milestone: ---

GCC trunk accepts the following invalid program:
https://godbolt.org/z/h5q7589Tr

```
template <int&> struct X{};

template <auto V> int func(X<V>) { return 1; }

int i;
int main() { return func(X<i>{}); }

```

Clang rejects the above program while gcc and msvc accepts it.

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

end of thread, other threads:[~2022-12-28 19:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-27 13:54 [Bug c++/108234] New: GCC accepts invalid program involving nontype template parameter of auto with non constexpr variable jlame646 at gmail dot com
2022-12-28 19:22 ` [Bug c++/108234] " pinskia at gcc dot gnu.org
2022-12-28 19:35 ` pinskia at gcc dot gnu.org
2022-12-28 19:37 ` pinskia at gcc dot gnu.org
2022-12-28 19:38 ` 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).