public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/96977] New: mangling ‘typeof’ or use ‘decltype’
@ 2020-09-08 12:12 tangyixuan at mail dot dlut.edu.cn
  0 siblings, 0 replies; only message in thread
From: tangyixuan at mail dot dlut.edu.cn @ 2020-09-08 12:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 96977
           Summary: mangling ‘typeof’ or use ‘decltype’
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tangyixuan at mail dot dlut.edu.cn
  Target Milestone: ---

Hi, GCC can not compile the following code, while Clang can. When I try to
replaces "typeof" with "decltype", other errors happens.

$ cat s.cpp
int F ( int );
int F ( void (*)( int , int ));
template < typename T > void F0( T PA , __typeof__ ( F ( PA )) PB ){}
template < typename T > void F1( __typeof__ ( F ( F0< T >))){}
int main (){ long long a ; F1< int >(0); return 0;}

$ clang++ -c s.cpp
success.

$ g++ -c s.cpp
s.cpp: In instantiation of ‘void F1(__typeof__ (F(F0<T>))) [with T = int]’:
s.cpp:4:30: sorry, unimplemented: mangling ‘typeof’, use ‘decltype’ instead
    4 | template < typename T > void F1( __typeof__ ( F ( F0< T >))){}


$ g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc-20200823/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/gcc-20200823/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-11-20200823/configure --prefix=/usr/local/gcc-20200823
--enable-checking=release --enable-languages=c,c++ --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.0.0 20200823 (experimental) (GCC)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-09-08 12:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08 12:12 [Bug c++/96977] New: mangling ‘typeof’ or use ‘decltype’ tangyixuan at mail dot dlut.edu.cn

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).