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++/17011] New: [3.4/3.5 regression] invalid default parameter diagnosed too late


On 3.4 branch and mainline the invalid default parameter is only
diagnosed at instantiation time and not at definition time:

======================================
template<typename> struct A {};

template<typename T> struct B
{
    A<T> a;

    void foo(A<T>* = &a);

    void bar() { foo(); }
};

// template struct B<int>;
======================================

On the 3.3 branch we get the error message already at defintion time:

bug.cc:7: error: invalid use of member `B<T>::a'

-- 
           Summary: [3.4/3.5 regression] invalid default parameter diagnosed
                    too late
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid, diagnostic
          Severity: enhancement
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org,mark at codesourcery dot
                    com
 BugsThisDependsOn: 16929


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


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