PR c++/38850
* pt.c (tsubst_copy_and_build): Tell finish_call_expr to
accept hidden friends.
From-SVN: r143423
+2009-01-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/38850
+ * pt.c (tsubst_copy_and_build): Tell finish_call_expr to
+ accept hidden friends.
+
2009-01-12 Dodji Seketeli <dodji@redhat.com>
PR c++/36019
qualified_p ? LOOKUP_NONVIRTUAL : LOOKUP_NORMAL,
/*fn_p=*/NULL));
}
+ /* Pass true for koenig_p so that build_new_function_call will
+ allow hidden friends found by arg-dependent lookup at template
+ parsing time. */
return finish_call_expr (function, call_args,
/*disallow_virtual=*/qualified_p,
- koenig_p);
+ /*koenig_p*/true);
}
case COND_EXPR:
+2009-01-15 Jason Merrill <jason@redhat.com>
+
+ PR c++/38850
+ * g++.dg/template/koenig6.C: New test.
+
2009-01-12 Dodji Seketeli <dodji@redhat.com>
PR c++/36019
--- /dev/null
+// PR c++/38850
+
+template <typename VType>
+class Vector2 {
+ private:
+ VType c_[2];
+ public:
+ typedef Vector2<VType> Self;
+
+ Vector2(const VType x, const VType y) {
+ c_[0] = x;
+ c_[1] = y;
+ }
+
+ friend inline Self Max(const Self &v1, const Self &v2) {
+ return Self(v1.c_[0], v1.c_[1]);
+ }
+};
+
+template <class T>
+Vector2<float> foo(T x) {
+ Vector2<float> y(0,0);
+ return Max(y, y);
+}
+
+int main() {
+ foo(3);
+ return 0;
+}