2016-03-18 20:50 GMT+06:00 Richard Smith <rich...@metafoo.co.uk>:

> rsmith added a comment.
>
> Can we instead not add the function to the redeclaration chain until it's
> instantiated (like we do if it's dependent)?
>
>
I prepared implementation that uses this approach. In this variant
information about potential definitions is lost, in some cases it makes
difficult to make analysis. For instance we can diagnose misfit of
declarations in the code:
```
void func9(int);  // expected-note{{previous declaration is here}}
template<typename T> struct C9a {
  friend int func9(int);  // expected-error{{functions that differ only in
their return type cannot be overloaded}}
};
```
but not in the case:
```
template<typename T> struct C9a {
  friend int func9(int);
};
void func9(int);
```
Otherwise both approaches seem almost equivalent.

Thanks,
--Serge
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to