===================================================================
@@ -0,0 +1,22 @@
+// PR c++/51189
+// { dg-do compile }
+
+struct A
+{
+ int i1, i2, i3, i4, i5, i6;
+};
+
+struct B : A
+{
+ using A::i1;
+ using A::i2;
+ using A::i3;
+ using A::i4;
+ using A::i5;
+ using A::i6;
+};
+
+struct C : B
+{
+ using B::i1;
+};
===================================================================
@@ -0,0 +1,20 @@
+// PR c++/51188
+// { dg-do compile }
+
+#include <utility>
+class XBase {
+public:
+ virtual ~XBase() = 0;
+ enum ImpMode { Imp1, Imp2, Imp3 };
+};
+class X : public XBase {
+ class XBlock {};
+ using XBase::ImpMode;
+ using XBase::Imp3;
+ using XBase::Imp1;
+ using XBase::Imp2;
+ int _XBlocked;
+ std::pair<int,int> getImp(void) const {
+ return (std::make_pair(0, static_cast<int>(X::Imp1)));
+ }
+};
===================================================================
@@ -0,0 +1,65 @@
+// PR c++/51141
+// { dg-do compile }
+// { dg-options "-fpermissive -w -Werror" }
+
+typedef int size_t;
+template < size_t, size_t > struct AlignedBuffer;
+template < size_t size > struct AlignedBuffer
+ < size, 8 > {
+};
+
+template < typename > class VectorBufferBase
+{
+public:
+ allocateBuffer (size_t) {
+ }
+ buffer () {
+ }
+ *m_buffer;
+ size_t m_capacity;
+};
+
+template < typename T, size_t > class VectorBuffer:VectorBufferBase < T >
+{
+ typedef VectorBufferBase < T > Base;
+
+public:
+ VectorBuffer () {
+ }
+ allocateBuffer (size_t) {
+ m_capacity = 0;
+ }
+ Base::buffer;
+ Base::m_buffer;
+ Base::m_capacity;
+ size_t m_inlineBufferSize;
+
+ AlignedBuffer < 0, __alignof__ (T) > m_inlineBuffer;
+};
+
+template < typename T, size_t > class Vector
+{
+ typedef VectorBuffer < T,
+ 0 > Buffer;
+public:
+ void shrinkCapacity (size_t);
+
+ clear () {
+ shrinkCapacity (0);
+ }
+ Buffer m_buffer;
+};
+
+template < typename T, size_t inlineCapacity > void Vector < T,
+ inlineCapacity >::shrinkCapacity (size_t)
+{
+ m_buffer.allocateBuffer (0);
+}
+
+struct PatternDisjunction;
+struct YarrPattern {
+ reset () {
+ m_disjunctions.clear ();
+ }
+ Vector < PatternDisjunction *, 0 > m_disjunctions;
+};
===================================================================
@@ -0,0 +1,29 @@
+// PR c++/51152
+// { dg-do compile }
+
+struct A
+{
+ int a;
+};
+
+struct B
+{
+ int b1;
+ int b2;
+ A b3;
+};
+
+struct C : B
+{
+ typedef int R;
+ typedef int S;
+ typedef int T;
+ using B::b1;
+ using B::b2;
+ using B::b3;
+ void f()
+ {
+ b3.a;
+ b3.~A();
+ }
+};
===================================================================
@@ -0,0 +1,23 @@
+// PR c++/51190
+// { dg-do compile }
+
+struct A
+{
+ int i;
+};
+
+template<typename> struct B
+{
+ A* p;
+};
+
+template<typename T> struct C : B<T>
+{
+ using B<T>::p;
+
+ C() { p->i; }
+
+ int i1, i2, i3, i4, i5;
+};
+
+C<A> c;
===================================================================
@@ -436,6 +436,14 @@ lookup_field_1 (tree type, tree name, bo
field = fields[i++];
while (i < hi && DECL_NAME (fields[i]) == name);
}
+
+ if (field)
+ {
+ field = strip_using_decl (field);
+ if (is_overloaded_fn (field))
+ field = NULL_TREE;
+ }
+
return field;
}
}