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++/16438] New: "template argument is required for <...>"


template <class P1>
struct X
{
    template <typename T>
    struct Y;
};

template <class P1, typename T>
struct X<P1>::Y
{
    template <typename U>
    struct r
    {
        typedef Y<U> other;
    };
};

int main(void)
{
    X<char>::Y<int>::r<char> x;
}

Note that the definition of Y has the wrong template nesting depth (according to
Comeau online), and that should be the diagnostic given (rather than the
misleading diagnostic given for r).  This is the correct definition of Y:

template <class P1>
template <typename T>
struct X<P1>::Y
{
    template <typename U>
    struct r
    {
        typedef Y<U> other;
    };
};

-- 
           Summary: "template argument is required for <...>"
           Product: gcc
           Version: 3.3.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dheld at codelogicconsulting dot com
                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=16438


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