public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106478] New: GCC rejects valid code involving partial specialization of variable template
@ 2022-07-29 16:49 jlame646 at gmail dot com
  2022-07-31 20:08 ` [Bug c++/106478] " pinskia at gcc dot gnu.org
  2022-07-31 20:08 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: jlame646 at gmail dot com @ 2022-07-29 16:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106478
           Summary: GCC rejects valid code involving partial
                    specialization of variable template
           Product: gcc
           Version: 11.2.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 program is incorrectly rejected by gcc. This can be verified
here: https://godbolt.org/z/f4c3d9voa

```
template<typename TSomeTemplate>
struct A
{
    static constexpr std::size_t B = 1;

    template<typename T, typename... Ts>
    static constexpr std::size_t C = 4;

    template<typename T>
    static constexpr std::size_t C<T> = B; //rejected by msvc and gcc
};

int main()
{
    int i = A<int>::C<int>;

    return 0;
}
```

The error for gcc says:

<source>:13:34: error: explicit template argument list not allowed
   13 |     static constexpr std::size_t C<T> = B; //rejected by msvc and gcc

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

* [Bug c++/106478] GCC rejects valid code involving partial specialization of variable template
  2022-07-29 16:49 [Bug c++/106478] New: GCC rejects valid code involving partial specialization of variable template jlame646 at gmail dot com
@ 2022-07-31 20:08 ` pinskia at gcc dot gnu.org
  2022-07-31 20:08 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-31 20:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 53392
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53392&action=edit
full testcase without headers

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

* [Bug c++/106478] GCC rejects valid code involving partial specialization of variable template
  2022-07-29 16:49 [Bug c++/106478] New: GCC rejects valid code involving partial specialization of variable template jlame646 at gmail dot com
  2022-07-31 20:08 ` [Bug c++/106478] " pinskia at gcc dot gnu.org
@ 2022-07-31 20:08 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-07-31 20:08 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup of bug 71954.

*** This bug has been marked as a duplicate of bug 71954 ***

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

end of thread, other threads:[~2022-07-31 20:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-29 16:49 [Bug c++/106478] New: GCC rejects valid code involving partial specialization of variable template jlame646 at gmail dot com
2022-07-31 20:08 ` [Bug c++/106478] " pinskia at gcc dot gnu.org
2022-07-31 20:08 ` 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).