public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107945] New: GCC accepts invalid program involving constexpr static data member of class template
@ 2022-12-01 13:20 jlame646 at gmail dot com
  2022-12-01 20:09 ` [Bug c++/107945] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jlame646 at gmail dot com @ 2022-12-01 13:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107945
           Summary: GCC accepts invalid program involving constexpr static
                    data member of class template
           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: ---

The following invalid program is accepted by gcc but rejected by clang and
msvc. https://godbolt.org/z/WGz3f75da

```
struct incomplete;
template<typename T> struct C
{
    static constexpr T t{};
};

template<class T>
struct myClass {
    C<T> new_t() { return {}; }
};

int main() {
    myClass<incomplete> d;
    d.new_t();    
}
```

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

end of thread, other threads:[~2024-05-03  7:58 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 13:20 [Bug c++/107945] New: GCC accepts invalid program involving constexpr static data member of class template jlame646 at gmail dot com
2022-12-01 20:09 ` [Bug c++/107945] " pinskia at gcc dot gnu.org
2022-12-01 20:10 ` pinskia at gcc dot gnu.org
2022-12-01 20:13 ` [Bug c++/107945] static constexpr incomplete (depedent) data member of a class template and in-member initialized accepted pinskia at gcc dot gnu.org
2024-04-02 14:26 ` [Bug c++/107945] static constexpr incomplete (depedent) data member of a class template and in-member initialized incorrectly accepted jlame646 at gmail dot com
2024-04-03  1:28 ` bbi5291 at gmail dot com
2024-05-03  7:58 ` 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).