[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-17 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2129 +def warn_class_template_argument_deduction_no_user_defined_guides : Warning< + "using class template argument deduction for %0 that has no user-defined dedu

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-16 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2129 +def warn_class_template_argument_deduction_no_user_defined_guides : Warning< + "using class template argument deduction for %0 that has no user-defined deduction guides" >, + InGroup, De

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-16 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 182206. EricWF marked 3 inline comments as done. EricWF added a comment. address comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56731/new/ https://reviews.llvm.org/D56731 Files: include/clang/Basic/DiagnosticGroups.td include/clang/Basi

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-16 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith accepted this revision. rsmith added inline comments. This revision is now accepted and ready to land. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2129 +def warn_class_template_argument_deduction_no_user_defined_guides : Warning< + "using class template argumen

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-16 Thread Geoffrey Romer via Phabricator via cfe-commits
gromer marked an inline comment as done. gromer added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2129 +def warn_class_template_argument_deduction_no_user_defined_guides : Warning< + "using class template argument deduction for %0 that has no user-def

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment. In D56731#1359190 , @rsmith wrote: > we need to keep in mind while making that decision that a warning that is > either off-by-default or turned off by nearly everyone delivers much less > value Agreed. I would expect the D

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 181972. EricWF added a comment. Address review comments. - Use "%0 maybe not intend to support ctad" like warning text. - Add note about suppression. - Rename `-Wimplicit-ctad` -> `-Wctad-maybe-unsupported` (Perhaps it should be `-Wctad-maybe-unintended`?) A

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF marked 10 inline comments as done. EricWF added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2129 +def warn_class_template_argument_deduction_no_user_defined_guides : Warning< + "using class template argument deduction for %0 that has no user-de

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. [This discussion should probably move to cfe-dev@, since it's not directly relevant for this patch.] In D56731#1358907 , @Quuxplusone wrote: > > Concretely, I think we could warn if, during template instantiation from a > > type-

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Geoffrey Romer via Phabricator via cfe-commits
gromer added a comment. In D56731#1358926 , @jdennett wrote: > In D56731#1358907 , @Quuxplusone > wrote: > > > For my own use-cases, I will continue to want a 100% comprehensive > > `-Wctad`. All these "heuristics

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread James Dennett via Phabricator via cfe-commits
jdennett added a comment. In D56731#1358907 , @Quuxplusone wrote: > For my own use-cases, I will continue to want a 100% comprehensive `-Wctad`. > All these "heuristics" you're proposing seem very ad-hoc, and make a lot of > work for the compiler vendor,

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added a comment. > Concretely, I think we could warn if, during template instantiation from a > type-dependent initializer, we select the copy deduction candidate and there > was another viable candidate (the `optional o(x)` case, the `tuple > t{args...}` case, etc), maybe under a n

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added a comment. I like @Quuxplusone's suggestions for more heuristics here, but I think they should probably live under a different warning flag (collectively grouped under `-Wctad` as @lebedev.ri suggested). Concretely, I think we could warn if, during template instantiation from a typ

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments. Comment at: test/SemaCXX/cxx1z-class-template-argument-deduction.cpp:426 +// expected-warning@+1 {{class template argument deduction for 'NoExplicit' that has no user defined deduction guides}} +NoExplicit ne(42); + EricWF wrot

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Geoffrey Romer via Phabricator via cfe-commits
gromer added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2129 +def warn_class_template_argument_deduction_no_user_defined_guides : Warning< + "using class template argument deduction for %0 that has no user-defined deduction guides" >, + InGroup, De

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF updated this revision to Diff 181829. EricWF marked an inline comment as done. EricWF added a comment. Address inline comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56731/new/ https://reviews.llvm.org/D56731 Files: include/clang/Basic/DiagnosticGroups.td include/cla

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF marked 6 inline comments as done. EricWF added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2129 +def warn_class_template_argument_deduction_no_user_defined_guides : Warning< + "class template argument deduction for %0 that has no user defined d

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:2129 +def warn_class_template_argument_deduction_no_user_defined_guides : Warning< + "class template argument deduction for %0 that has no user defined deduction guides" >, + InGroup, Def

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: include/clang/Basic/DiagnosticGroups.td:1054 + +def ImplicitCTADUsage : DiagGroup<"implicit-ctad">; Should this be in some group? Alternatively, would it make sense to add it to new `-Wctad` group?

[PATCH] D56731: Add -Wimplicit-ctad warning to diagnose CTAD on types with no user defined deduction guides.

2019-01-15 Thread Eric Fiselier via Phabricator via cfe-commits
EricWF created this revision. EricWF added reviewers: rsmith, james.dennett, gromer. Some style guides want to allow using CTAD only on types that "opt-in"; i.e. on types that are designed to support it and not just types that *happen* to work with it. This patch implements the `-Wimplicit-ctad