diff options
author | Eric Fiselier <eric@efcs.ca> | 2019-01-17 21:44:24 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2019-01-17 21:44:24 +0000 |
commit | 73b51ae160af6b94d4468331ff3fb6855cff3b18 (patch) | |
tree | b27bdad8e3d3de4d1d73c1a145e9b8ea6ea49341 /llvm/lib/Target/Mips/MipsMCInstLower.cpp | |
parent | 4541be0686e682ea6e30933d9893fd2701b0e27f (diff) | |
download | bcm5719-llvm-73b51ae160af6b94d4468331ff3fb6855cff3b18.tar.gz bcm5719-llvm-73b51ae160af6b94d4468331ff3fb6855cff3b18.zip |
Add -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction guides.
Summary:
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 `-Wctad-maybe-unsupported` warning, which is off by default, which warns when CTAD is used on a type that does not define any deduction guides.
The following pattern can be used to suppress the warning in cases where the type intentionally doesn't define any deduction guides:
```
struct allow_ctad_t;
template <class T>
struct TestSuppression {
TestSuppression(T) {}
};
TestSuppression(allow_ctad_t)->TestSuppression<void>; // guides with incomplete parameter types are never considered.
```
Reviewers: rsmith, james.dennett, gromer
Reviewed By: rsmith
Subscribers: jdennett, Quuxplusone, lebedev.ri, cfe-commits
Differential Revision: https://reviews.llvm.org/D56731
llvm-svn: 351484
Diffstat (limited to 'llvm/lib/Target/Mips/MipsMCInstLower.cpp')
0 files changed, 0 insertions, 0 deletions