public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/47765] New: Wrong template deduction
@ 2011-02-16 12:32 dk_mipt at mail dot ru
  2011-09-08  9:22 ` [Bug c++/47765] " daniel.kruegler at googlemail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: dk_mipt at mail dot ru @ 2011-02-16 12:32 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Wrong template deduction
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dk_mipt@mail.ru


The following code fails to compile neither with g++ version 4.4.5
(Ubuntu/Linaro 4.4.4-14ubuntu5) nor with 4.5.1:


template<typename ItT>
struct traits {
        typedef typename ItT::value_type value_t;
};

template<typename ItT>
struct A {
        typedef typename traits<ItT>::value_t value_t;
};

template<typename T>
struct B {
        typedef T type_t;
};

struct C {

        template<typename T, typename T2>
        void foo(const A<T>& r) {}

        template<typename T>
        void foo(const B<T>& r) {}
};

void foo()
{
        B<char> b;
        C c;
        c.foo(b);
        c.foo<char>(b); // fails to compile
}


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

end of thread, other threads:[~2020-05-08 15:38 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-16 12:32 [Bug c++/47765] New: Wrong template deduction dk_mipt at mail dot ru
2011-09-08  9:22 ` [Bug c++/47765] " daniel.kruegler at googlemail dot com
2011-09-08 10:52 ` paolo.carlini at oracle dot com
2011-09-08 16:22 ` jason at gcc dot gnu.org
2011-09-08 17:05 ` daniel.kruegler at googlemail dot com
2011-09-08 19:23 ` jason at gcc dot gnu.org
2011-09-08 19:46 ` jason at gcc dot gnu.org
2013-05-25  8:51 ` paolo.carlini at oracle dot com
2013-05-25  9:19 ` daniel.kruegler at googlemail dot com
2013-05-25 11:07 ` [Bug c++/47765] [Core/1391] " paolo.carlini at oracle dot com
2015-03-20 16:57 ` paolo.carlini at oracle dot com
2020-05-08 15:38 ` mpolacek at gcc dot gnu.org

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).