Since PR 16929 got a little confusing, I'm opening a new PR for the
following problem:

Since gcc 3.4.0 we accept the following invalid code snippet. The invalid
default parameter "a" is not even diagnosed at instantiation time.
(This is different from PT 17011 - also a spin-off from PR16929 -
which is just a QoI issue.)

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

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

    void foo(A<T> = a);
};

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

With 3.3.5 and before we got a decent error message:
bug.cc:7: error: invalid use of member `B<T>::a'

-- 
           Summary: [3.4/4.0 regression] Invalid default parameter not
                    diagnosed.
           Product: gcc
           Version: 3.4.3
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          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


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

Reply via email to