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 | 8abc38eefae434edc7fc43ab41086bfccb0641e3 (patch) | |
| tree | c0fc99e81741caaf0e82ebe40311ced8dbf846e5 /lib/CodeGen/CGExprAgg.cpp | |
| parent | 025ee129ac0bfc0cad76eb6ac14bab9c1343b4ea (diff) | |
| download | clang-8abc38eefae434edc7fc43ab41086bfccb0641e3.tar.gz | |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351484 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
0 files changed, 0 insertions, 0 deletions
