philnik added inline comments.

================
Comment at: clang/lib/Sema/SemaInit.cpp:10932
+    DiagnoseCTADCopy();
+  } else if (!PP.getSourceManager().isInSystemHeader(Template->getLocation())) 
{
+    DiagnoseCTADCopy();
----------------
cor3ntin wrote:
> So the idea here is that the standard library would have protected against 
> that by providing deduction guides?
> Which is funny because the original issue was reported because they did not.
> Do you have an example of when we should not emit the diagnostic for a 
> library type?
> 
> @ldionne @philnik Opinions on this warning?
I think this definitely has to be suppressed in system headers somehow. e.g. 
`as_rvalue_view` uses the copy ctor CTAD to avoid double-wrapping iterators. 
(see 
https://github.com/llvm/llvm-project/blob/main/libcxx/include/__ranges/as_rvalue_view.h#L75).
 OTOH I'm not sure whether this should be suppressed if the type is from a 
system header, since `reverse_iterator{some-other-reverse-iterator}` might not 
be intended either, regardless of deduction guides.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155475/new/

https://reviews.llvm.org/D155475

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D155475: [Clang][S... Corentin Jabot via Phabricator via cfe-commits
    • [PATCH] D155475: [Cla... Nikolas Klauser via Phabricator via cfe-commits

Reply via email to