-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththis.cc
31 lines (28 loc) · 844 Bytes
/
this.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// This and ref-qualifiers.
struct S {
void f1(); // #1
void f2() &&; // #2
void f3() &; // #3
};
/* There's a difference between #1 and #3: old special handling permits
an rvalue to be bound to an lvalue reference to non-const type when
it's *this. See build_this_conversion: */
#if 0
bool this_p = true;
if (FUNCTION_REF_QUALIFIED (TREE_TYPE (fn)))
{
/* If the function has a ref-qualifier, the implicit
object parameter has reference type. */
bool rv = FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (fn));
parmtype = cp_build_reference_type (parmtype, rv);
/* The special handling of 'this' conversions in compare_ics
does not apply if there is a ref-qualifier. */
this_p = false;
#endif
int
main ()
{
S().f1();
S().f2();
//S().f3(); // error (build_over_call)
}