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++/42784] New: using declaration conflicts with a different declaration in one class.


g++ doesn't accept this code:

template<int N, int I=N> struct K;

template<int N> struct K<N, 1>
{
        void f();
};

template<int N, int I> struct K : public K<N, I-1>
{
        using K<N, I-1>::f;
        typedef const char A[N*I];
        void f(const A &) const;
};

template<int N> struct Q : public K<N>, public K<N-1>
{
    using K<N>::f;
    using K<N-1>::f; // error: using declaration ?using K<4, 4>::f? conflicts
with a previous using declaration
};

int main()
{
    Q<5> v;
    char a5x3[15];
    v.f(a5x3);
    char a4x2[8];
    v.f(a4x2);
}


-- 
           Summary: using declaration conflicts with a different declaration
                    in one class.
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: max at e-soft dot ru
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


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


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