Bug 42784 - using declaration conflicts with a different declaration in one class.
Summary: using declaration conflicts with a different declaration in one class.
Status: RESOLVED DUPLICATE of bug 25994
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-17 22:41 UTC by Maxim P. Dementiev
Modified: 2010-01-17 22:47 UTC (History)
4 users (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build: x86_64-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maxim P. Dementiev 2010-01-17 22:41:28 UTC
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);
}
Comment 1 Paolo Carlini 2010-01-17 22:47:47 UTC

*** This bug has been marked as a duplicate of 25994 ***