re PR c++/51141 (rev181359 causes Chromium build failure)
gcc/testsuite/ChangeLog 2011-11-18 Fabien Chene <fabien@gcc.gnu.org> PR c++/51141 * g++.dg/lookup/using46.C: New. * g++.dg/lookup/using47.C: New. * g++.dg/lookup/using48.C: New. * g++.dg/lookup/using49.C: New. * g++.dg/lookup/using50.C: New. gcc/cp/ChangeLog 2011-11-18 Fabien Chene <fabien@gcc.gnu.org> PR c++/51141 * search.c (lookup_field_1): Handle USING_DECLs for the storted case. From-SVN: r181490
This commit is contained in:
parent
4a0051e4db
commit
52e4e221bd
@ -1,3 +1,9 @@
|
||||
2011-11-18 Fabien Chêne <fabien@gcc.gnu.org>
|
||||
|
||||
PR c++/51141
|
||||
* search.c (lookup_field_1): Handle USING_DECLs for the storted
|
||||
case.
|
||||
|
||||
2011-11-18 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/51150
|
||||
|
@ -436,6 +436,14 @@ lookup_field_1 (tree type, tree name, bool want_type)
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +1,12 @@
|
||||
2011-11-18 Fabien Chêne <fabien@gcc.gnu.org>
|
||||
|
||||
PR c++/51141
|
||||
* g++.dg/lookup/using46.C: New.
|
||||
* g++.dg/lookup/using47.C: New.
|
||||
* g++.dg/lookup/using48.C: New.
|
||||
* g++.dg/lookup/using49.C: New.
|
||||
* g++.dg/lookup/using50.C: New.
|
||||
|
||||
2011-11-18 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
|
||||
|
||||
* gcc.c-torture/compile/pr44707.c: Do not assume assembler
|
||||
|
22
gcc/testsuite/g++.dg/debug/using6.C
Normal file
22
gcc/testsuite/g++.dg/debug/using6.C
Normal file
@ -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;
|
||||
};
|
62
gcc/testsuite/g++.dg/lookup/using46.C
Normal file
62
gcc/testsuite/g++.dg/lookup/using46.C
Normal file
@ -0,0 +1,62 @@
|
||||
// PR c++/51141
|
||||
// { dg-do compile }
|
||||
// { dg-options "-fpermissive -w -Werror" }
|
||||
|
||||
typedef int size_t;
|
||||
template < size_t, size_t > struct AlignedBuffer {};
|
||||
|
||||
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;
|
||||
};
|
29
gcc/testsuite/g++.dg/lookup/using47.C
Normal file
29
gcc/testsuite/g++.dg/lookup/using47.C
Normal file
@ -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();
|
||||
}
|
||||
};
|
23
gcc/testsuite/g++.dg/lookup/using48.C
Normal file
23
gcc/testsuite/g++.dg/lookup/using48.C
Normal file
@ -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;
|
20
gcc/testsuite/g++.dg/lookup/using49.C
Normal file
20
gcc/testsuite/g++.dg/lookup/using49.C
Normal file
@ -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)));
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user