* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / iop.C
blob6e71ce07550ec9216640cc2b008a8f018a1d4cc9
1 // I, Howard Hinnant, hereby place this code in the public domain.
3 // Test that the implicit object parameter is *not* an rvalue reference, but is instead
4 //   identical to that specified in C++03.  That is, the implicit object parameter is
5 //   an lvalue reference that can bind to an rvalue. :-\
6 //   See http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html under the
7 //   section "Revision 1 Summary and Rationale" for more details.
9 // { dg-do compile { target c++11 } }
10 // { dg-skip-if "packed attribute missing for struct one" { "epiphany-*-*" } }
12 template <bool> struct sa;
13 template <> struct sa<true> {};
15 struct one   {long x[1];};
16 struct two   {long x[2];};
18 struct os
20     one operator<<(int);
23 struct A
25     A(int);
28 two operator<<(os&, const A&);
30 void test()
32     os o;
33     sa<sizeof(o << 1) == 1 * sizeof(long)> t1;  // Calls os::operator<<(int)
34                                  // Would be ambiguous if the implicit object parameter
35                                  // was an rvalue reference.
38 int main()
40     return 0;