This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/42784] New: using declaration conflicts with a different declaration in one class.
- From: "max at e-soft dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jan 2010 22:41:28 -0000
- Subject: [Bug c++/42784] New: using declaration conflicts with a different declaration in one class.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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