[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-bugs
Subject:    [Bug c++/72760] New: incorrectly rejects valid C++ code that invokes __typeof__ on a specialized tem
From:       "su at cs dot ucdavis.edu" <gcc-bugzilla () gcc ! gnu ! org>
Date:       2016-07-30 23:46:13
Message-ID: bug-72760-4 () http ! gcc ! gnu ! org/bugzilla/
[Download RAW message or body]

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

            Bug ID: 72760
           Summary: incorrectly rejects valid C++ code that invokes
                    __typeof__ on a specialized template function
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The code is accepted by both Clang and ICC.  It is rejected by all versions of
GCC since at least as early as 4.4.x. 


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160730 (experimental) [trunk revision 238903] (GCC) 
$ 
$ clang++-3.8 -c small.cpp
$ 
$ g++-trunk -c small.cpp
small.cpp:3:22: error: type of ‘f<int>' is unknown
 __typeof__ (f < int >) a;
                      ^
$ 


------------------------------------


template < typename T > T f (T x); 

__typeof__ (f < int >) a;=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic