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++/13590] [3.3/3.4/3.5 regression] [DR39] Non-existing ambiguity when inhering through virtuals two identical using declarations.


------- Additional Comments From boris at kolpackov dot net  2004-08-03 14:31 -------
Just found a non-academic example when this really hurts:

template<typename x>
struct base
{
  void f ();
};


template <typename x>
struct a : virtual base<x>
{
  using base<x>::f;  // which f

  void g ()
  {
    f ();
  }
};

template <typename x>
struct b : virtual base<x>
{
  using base<x>::f; // which f

  void g ()
  {
    f ();
  }
};

struct c : a<int>, b<int> {};

void
f ()
{
  c c_;
  c_.f ();
}

Here I use using-declaration to hind the compiler which f() I am using since it
does not depend on template parameter in any way. The result - call to c_.f ()
is ambiguous - IMO, is ridiculous.


-- 


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


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