================
@@ -230,6 +230,37 @@ namespace cwg211 { // cwg211: 2.7
};
} // namespace cwg211
+namespace cwg212 { // cwg212: yes
+ template<typename T> struct Base;
+ template<typename T> struct Derived;
+
+ int *overload(void*);
+ float *overload(Base<int>*);
+ double *overload(Base<long>*);
+
+ void f(Derived<int> *p) {
+ // OK, calls void* overload.
+ int *a = overload(p);
+
+ Base<int> *q = p; // expected-error {{cannot initialize}}
----------------
Endilll wrote:
```suggestion
Base<int> *q = p;
// expected-error@-1 {{cannot initialize a variable of type 'Base<int> *'
with an lvalue of type 'Derived<int> *'}}
```
https://github.com/llvm/llvm-project/pull/165633
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits