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++/14260] New: [3.4 REGRESSION] default arguments are only permitted for function parameters


Hi,  
 
testcase:  
 
== Cut == 
template <class TClass> 
class T 
{ 
public: 
        T(short,short f=0) {} 
        T<TClass>(int f) {} 
        T<TClass>(int f=0,const char* b=0) {} 
}; 
=== Cut === 
produces : 
 
$  g++ -v -Wall -ansi -pedantic -c kircfunctors.cpp  
.. 
gcc version 3.4.0 20040220 (prerelease) 
... 
kircfunctors.cpp:7: error: default arguments are only permitted for function 
parameters 
kircfunctors.cpp:7: error: default arguments are only permitted for function 
parameters 
 
Something is inconsistent here.. either it should reject declaration 2 
and 3, or none of them (like gcc 3.3.x does for me). The diagnostic is  
showing that it has some problems parsing this correctly.

-- 
           Summary: [3.4 REGRESSION] default arguments are only permitted
                    for function parameters
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mueller at kde dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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