public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/42784]  New: using declaration conflicts with a different declaration in one class.
@ 2010-01-17 22:41 max at e-soft dot ru
  2010-01-17 22:48 ` [Bug c++/42784] " paolo dot carlini at oracle dot com
  0 siblings, 1 reply; 2+ messages in thread
From: max at e-soft dot ru @ 2010-01-17 22:41 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1103 bytes --]

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/42784] using declaration conflicts with a different declaration in one class.
  2010-01-17 22:41 [Bug c++/42784] New: using declaration conflicts with a different declaration in one class max at e-soft dot ru
@ 2010-01-17 22:48 ` paolo dot carlini at oracle dot com
  0 siblings, 0 replies; 2+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-01-17 22:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from paolo dot carlini at oracle dot com  2010-01-17 22:47 -------


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


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-17 22:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-17 22:41 [Bug c++/42784] New: using declaration conflicts with a different declaration in one class max at e-soft dot ru
2010-01-17 22:48 ` [Bug c++/42784] " paolo dot carlini at oracle dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).