public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101848] New: Template metaprogramming errors in v11.1
@ 2021-08-10 15:10 qwdkguneykiffmmuyd at uivvn dot net
  2021-08-10 15:25 ` [Bug c++/101848] " rguenth at gcc dot gnu.org
  2021-08-10 15:27 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: qwdkguneykiffmmuyd at uivvn dot net @ 2021-08-10 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101848
           Summary: Template metaprogramming errors in v11.1
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: qwdkguneykiffmmuyd at uivvn dot net
  Target Milestone: ---

Created attachment 51285
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51285&action=edit
Preprocessed file

This program fails to compile with g++ 11.1.0 with the following template
errors, but DOES compile and execute with clang++ 12.0.1 on the same hardware.
It is reported here in case such behavior is not intended. As instructed, the
preprocessed file is included but not the original CPP file, which was
explicitly listed as not to include.

+verbatim+
$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++,d --with-isl
--with-linker-hash-style=gnu --with-system-zlib --enable-__cxa_atexit
--enable-cet=auto --enable-checking=release --enable-clocale=gnu
--enable-default-pie --enable-default-ssp --enable-gnu-indirect-function
--enable-gnu-unique-object --enable-install-libiberty --enable-linker-build-id
--enable-lto --enable-multilib --enable-plugin --enable-shared
--enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-libunwind-exceptions --disable-werror
gdc_include_dir=/usr/include/dlang/gdc
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.1.0 (GCC) 
-verbatim-


+verbatim+
$ g++ kirktemp.cpp 
kirktemp.cpp:60:12: error: explicit specialization in non-namespace scope
‘struct ValidSched<numdays>’
   60 |   template<> struct daytriad<numdays-1>
      |            ^
kirktemp.cpp:60:21: error: too few template-parameter-lists
   60 |   template<> struct daytriad<numdays-1>
      |                     ^~~~~~~~~~~~~~~~~~~
kirktemp.cpp: In instantiation of ‘struct ValidSched<1>::daytriad<0>’:
kirktemp.cpp:52:82:   recursively required from ‘struct
ValidSched<34>::daytriad<0>’
kirktemp.cpp:52:82:   required from ‘struct ValidSched<35>::daytriad<0>’
kirktemp.cpp:71:28:   required from ‘static void
ValidSched<numdays>::printschedule() [with int numdays = 35]’
kirktemp.cpp:83:19:   required from here
kirktemp.cpp:52:82: error: invalid use of incomplete type ‘struct
ValidSched<0>::daytriad<0>’
   52 |     typedef typename ValidSched<numdays-1>::template
daytriad<day>::thisdaytriad thisdaytriad;
      |                                                                        
         ^~~~~~~~~~~~
kirktemp.cpp:78:24: note: declaration of ‘struct ValidSched<0>::daytriad<0>’
   78 |   template<int> struct daytriad;
      |                        ^~~~~~~~

-verbatim-

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

* [Bug c++/101848] Template metaprogramming errors in v11.1
  2021-08-10 15:10 [Bug c++/101848] New: Template metaprogramming errors in v11.1 qwdkguneykiffmmuyd at uivvn dot net
@ 2021-08-10 15:25 ` rguenth at gcc dot gnu.org
  2021-08-10 15:27 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-08-10 15:25 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-08-10
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |11.2.0, 12.0

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  clang takes quite some time compiling this.

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

* [Bug c++/101848] Template metaprogramming errors in v11.1
  2021-08-10 15:10 [Bug c++/101848] New: Template metaprogramming errors in v11.1 qwdkguneykiffmmuyd at uivvn dot net
  2021-08-10 15:25 ` [Bug c++/101848] " rguenth at gcc dot gnu.org
@ 2021-08-10 15:27 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-10 15:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|11.2.0, 12.0                |
   Last reconfirmed|2021-08-10 00:00:00         |
           Keywords|rejects-valid               |
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It is only valid C++17 :).

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

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

end of thread, other threads:[~2021-08-10 15:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-10 15:10 [Bug c++/101848] New: Template metaprogramming errors in v11.1 qwdkguneykiffmmuyd at uivvn dot net
2021-08-10 15:25 ` [Bug c++/101848] " rguenth at gcc dot gnu.org
2021-08-10 15:27 ` 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).