public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114491] New: incorrect identifier namespacing with variadic templates
@ 2024-03-27  0:20 christoph.schied at gmail dot com
  2024-03-27  0:25 ` [Bug c++/114491] " pinskia at gcc dot gnu.org
  2024-03-27  0:26 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: christoph.schied at gmail dot com @ 2024-03-27  0:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114491
           Summary: incorrect identifier namespacing with variadic
                    templates
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: christoph.schied at gmail dot com
  Target Milestone: ---

Created attachment 57818
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57818&action=edit
same source code as posted in the description

The following code fails to compile with g++, however it works with clang. I
tried various versions of gcc in godbolt (https://godbolt.org/z/xqfoc4Yce)
using std=c++17 and std=c++20 and the code fails to compile on all versions. It
appears that the dependent type T gets confused with the template argument of
the function.

template<typename A, typename... X>
void works()
{
    typename A::T var;
}

template<typename A, typename... T>
void broken()
{
    typename A::T var; /* A::T and T seem to clash */
}


results in:
<source>: In function 'void broken()':
<source>:10:19: error: parameter packs not expanded with '...':
   10 |     typename A::T var; /* A::T and T seem to clash */
      |                   ^~~
<source>:10:19: note:         'T'

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

end of thread, other threads:[~2024-03-27  0:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-27  0:20 [Bug c++/114491] New: incorrect identifier namespacing with variadic templates christoph.schied at gmail dot com
2024-03-27  0:25 ` [Bug c++/114491] " pinskia at gcc dot gnu.org
2024-03-27  0:26 ` 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).