lebedev.ri added a comment.

Ok, once we understand why "field" diag is separate, and why since initial 
implementation it only warned for "builtin" operators, i'll work on the code 
further.

In https://reviews.llvm.org/D44883#1048485, @rjmccall wrote:

> That's an interesting question!  You're absolutely right, I do think we 
> should warn about trivial C++ assignments as part of the builtin group.  If a 
> C program includes a self-assignment that happens to be of struct type, we'll 
> warn about that, and it seems to be that we shouldn't lose the warning just 
> because that code is compiled as C++ instead.
>
> As for your example, I think it should be based on whether the assignment 
> operator selected is trivial.  If it's non-trivial, even if it's defaulted, 
> we should warn about it as a "user-defined" operator, since ultimately it 
> does involve calling such an operator.


To summarize:
https://godbolt.org/g/gwDASe - `A`, `B` and `C` case should be treated as 
built-in, and `D`, `E` and `F` as user-defined.


Repository:
  rC Clang

https://reviews.llvm.org/D44883



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

Reply via email to