Go to file
Eric Fiselier 73b51ae160 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
2019-01-17 21:44:24 +00:00
clang Add -Wctad-maybe-unsupported to diagnose CTAD on types with no user defined deduction guides. 2019-01-17 21:44:24 +00:00
clang-tools-extra [clang-tidy] Add abseil-duration-conversion-cast check 2019-01-17 20:37:35 +00:00
compiler-rt xray: Add missing header to list of installed headers. 2019-01-17 21:11:49 +00:00
debuginfo-tests Set config.lit_tools_dir, which is needed by lit.llvm.initialize. 2018-11-06 21:54:27 +00:00
libclc Update year in license files 2019-01-15 15:10:32 +00:00
libcxx [hurd] Fix unconditional use of PATH_MAX 2019-01-17 02:59:28 +00:00
libcxxabi [demangler] Support for block literals. 2019-01-17 21:37:51 +00:00
libunwind Bump the trunk version to 9.0.0svn 2019-01-16 10:57:02 +00:00
lld [WebAssembly] Changed objdump output to offsets instead of indices. 2019-01-17 18:30:35 +00:00
lldb Recommit "Teach the default symbol vendor to respect module.GetSymbolFileFileSpec()" 2019-01-17 15:07:35 +00:00
llgo Update year in license files 2019-01-15 15:10:32 +00:00
llvm [HotColdSplit] Relax requirement that the cold sink block be extractable 2019-01-17 21:42:36 +00:00
openmp Revert r351311 "[OMPT] Make sure that OMPT is enabled when accessing internals of the runtime" 2019-01-17 11:31:03 +00:00
parallel-libs Update year in license files 2019-01-15 15:10:32 +00:00
polly Bump the trunk version to 9.0.0svn 2019-01-16 10:57:02 +00:00
pstl Update year in license files 2019-01-15 15:10:32 +00:00
.arcconfig Add an .arcconfig for the top of the git monorepo. 2019-01-11 16:27:14 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.