Merge from mainline (167278:168000).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / template / koenig6.C
blob8f93a653a7b27234d470113536fdee609b02fddd
1 // PR c++/38850
3 template <typename VType>
4 class Vector2 {
5  private:
6   VType c_[2];
7  public:
8   typedef Vector2<VType> Self;
10   Vector2(const VType x, const VType y) {
11     c_[0] = x;
12     c_[1] = y;
13   }
15   friend inline Self Max(const Self &v1, const Self &v2) {
16     return Self(v1.c_[0], v1.c_[1]);
17   }
20 template <class T>
21 Vector2<float> foo(T x) {
22   Vector2<float> y(0,0);
23   return Max(y, y);
26 int main() {
27   foo(3);
28   return 0;