This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/14409] New: [3.3/3.4/3.5 regression] Accepts invalid function signature for explicit instantiation


3.3, 3.4 and mainline accept this piece of invalid code (note the 
missing 'const' on the signature in the explicit instantiation): 
-------------------- 
template <typename T> struct X 
{ 
    template <typename U> void foo (U) const {}; 
}; 
 
template void X<int>::foo (int); 
-------------------- 
 
On the other hand, 2.95 rejected this: 
g/x> /home/bangerth/bin/gcc-2*/bin/c++ -c x.cc 
x.cc:6: template-id `foo<>' for `X<int>::foo(int)' does not match any template 
declaration 
x.cc:6: confused by earlier errors, bailing out 
 
So this is a regression. 
 
W.

-- 
           Summary: [3.3/3.4/3.5 regression] Accepts invalid function
                    signature for explicit instantiation
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14409


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]