+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.
--- /dev/null
+// { 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)
+}
--- /dev/null
+// { 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];
--- /dev/null
+
+// 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);
+}
template <typename T> struct B : T
{
- B() { foo(T()); }
+ B() { foo(T()); } // { dg-error "cannot convert" }
};
B<A> b;
struct helper {};
template<class F>
-void bla(F f)
+void bla(F f) // { dg-error "candidates" }
{
}
{
definition()
{
- bla(coperator_stack::push3<helper>); // { dg-error "" }
+ bla(coperator_stack::push3<helper>); // { dg-error "" }
}
};
// 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
{
void SpyExample::ready()
{
- queryAliases(inputs); // { dg-error "" }
+ queryAliases(inputs); // { dg-error "" }
}
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();