summaryrefslogtreecommitdiffhomepage
path: root/CompilerDriver/cc2/regression-tests/mixed-parameter-passing-generic-out.cpp2
blob: c5c4e91dede4dae8b0080634e3060d55c13d2832 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>

struct X {
    X(int) { }
};
auto operator<<(std::ostream& o, X const&) -> std::ostream& {
    o << "exxxx";
    return o;
}

f: (out x: _) = {
    x = 42;
}

main: ()->int = {
    a: int;
    f(out a);
    std::cout << a << "\n";

    b: X;
    f(out b);
    std::cout << b << "\n";
}