Commit 3a9d5f26 by Douglas Gregor Committed by Doug Gregor

re PR c++/2922 ([DR 197] two-stage lookup for unqualified function calls with…

re PR c++/2922 ([DR 197] two-stage lookup for unqualified function calls with type-dependent arguments)

2005-07-20  Douglas Gregor <doug.gregor@gmail.com>

	PR c++/2922
	* g++.dg/lookup/two-stage2.C: New.
	* g++.dg/lookup/two-stage3.C: New.
	* g++.dg/lookup/two-stage4.C: New. Illustrates how we have not yet
	fixed two-stage name lookup for operators.
	* g++.dg/template/call3.C: Compiler now produces an appropriate
	error message.
	* g++.dg/template/crash37.C: Compiler now describes bla() on line
	14 as a candidate.
	* g++.dg/template/ptrmem4.C: Compiler produces different error
	message.
	* g++.old-deja/g++.other/pmf3.C: Compiler now describes
	connect_to_method as a candidate.

From-SVN: r102217
parent 20ac1e03
2005-07-20 Douglas Gregor <doug.gregor@gmail.com>
PR c++/2922
* g++.dg/lookup/two-stage2.C: New.
* g++.dg/lookup/two-stage3.C: New.
* g++.dg/lookup/two-stage4.C: New. Illustrates how we have not yet
fixed two-stage name lookup for operators.
* g++.dg/template/call3.C: Compiler now produces an appropriate
error message.
* g++.dg/template/crash37.C: Compiler now describes bla() on line
14 as a candidate.
* g++.dg/template/ptrmem4.C: Compiler produces different error
message.
* g++.old-deja/g++.other/pmf3.C: Compiler now describes
connect_to_method as a candidate.
2005-07-20 James A. Morrison <phython@gcc.gnu.org>
* gcc.dg/fold-alloc-1.c: New test.
......
// { dg-do compile }
// PR c++/2922
char& f(char);
template<class T>
void g(T t)
{
char& c1 = f(1); // not dependent
char& c2 = f(t); // dependent
}
int&f (int);
int main()
{
g(2); // f(char) followed by f(int)
g('a'); // two f(char)
}
// { dg-do compile }
// PR c++/2922
namespace tpl_ {
template<class T>
char test(T);
template<class T>
struct check
{
static T const t;
enum { value = 1 == sizeof(test(t)) };
};
double test(int);
}
bool const two_phase_lookup_supported = tpl_::check<int>::value;
int compile_time_assert[two_phase_lookup_supported ? 1 : -1];
// Contributed by Douglas Gregor <doug.gregor@gmail.com>
template<class T> struct wrap {};
template<typename T> bool& operator==(wrap<T>, wrap<T>);
template<typename T>
void g(T, wrap<wrap<int> > x)
{
bool& b = x == x; // { dg-bogus "invalid initialization of reference" "" { xfail *-*-*} }
}
template<typename T> int& operator==(wrap<wrap<T> >, wrap<wrap<T> >);
void h()
{
wrap<wrap<int> > x;
g(17, x);
}
......@@ -9,7 +9,7 @@ struct A
template <typename T> struct B : T
{
B() { foo(T()); }
B() { foo(T()); } // { dg-error "cannot convert" }
};
B<A> b;
......@@ -11,7 +11,7 @@ struct coperator_stack
struct helper {};
template<class F>
void bla(F f)
void bla(F f) // { dg-error "candidates" }
{
}
......@@ -20,7 +20,7 @@ struct definition
{
definition()
{
bla(coperator_stack::push3<helper>); // { dg-error "" }
bla(coperator_stack::push3<helper>); // { dg-error "" }
}
};
......@@ -6,7 +6,7 @@
// Pointer to member function template argument deduction ICE.
template <class CONT> void queryAliases(CONT& fill_me); // { dg-error "argument" }
template <class CONT> void queryAliases(CONT& fill_me); // { dg-error "candidates" }
struct SpyExample
{
......@@ -16,5 +16,5 @@ struct SpyExample
void SpyExample::ready()
{
queryAliases(inputs); // { dg-error "" }
queryAliases(inputs); // { dg-error "" }
}
......@@ -5,11 +5,11 @@
template<class T>
void connect_to_method(
T *receiver,
void (T::*method)())
void (T::*method)()) // { dg-error "candidates are" }
{}
class Gtk_Base
{
{
public:
void expose();
void show();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment