Re: C++ PATCH for c++/91844 - Implement CWG 2352, Similar types and reference binding.

2019-09-23 Thread Jason Merrill
On 9/23/19 12:06 PM, Marek Polacek wrote: On Mon, Sep 23, 2019 at 10:17:00AM -0400, Jason Merrill wrote: On 9/22/19 3:23 PM, Marek Polacek wrote: + /* Informally, two types are similar if, ignoring top-level cv-qualification: + * they are the same type; or + * they are both pointers,

Re: C++ PATCH for c++/91844 - Implement CWG 2352, Similar types and reference binding.

2019-09-23 Thread Marek Polacek
On Mon, Sep 23, 2019 at 10:17:00AM -0400, Jason Merrill wrote: > On 9/22/19 3:23 PM, Marek Polacek wrote: > > + /* Informally, two types are similar if, ignoring top-level > > cv-qualification: > > + * they are the same type; or > > + * they are both pointers, and the pointed-to types

Re: C++ PATCH for c++/91844 - Implement CWG 2352, Similar types and reference binding.

2019-09-23 Thread Jason Merrill
On 9/22/19 3:23 PM, Marek Polacek wrote: + /* Informally, two types are similar if, ignoring top-level cv-qualification: + * they are the same type; or + * they are both pointers, and the pointed-to types are similar; or + * they are both pointers to member of the same class, and

C++ PATCH for c++/91844 - Implement CWG 2352, Similar types and reference binding.

2019-09-22 Thread Marek Polacek
I came across this DR while looking into P0388R4 and realized I need to implement it before tackling P0388R4. DR 2352 changes the definitions of reference-related (so that it uses "similar type" instead of "same type") and of reference-compatible (use a standard conversion sequence), and then