Go to file
Jonas Toth a5d53274f3 [clang-tidy] Implement type-based check for `gsl::owner`
This check implements the typebased semantic of `gsl::owner`.
Meaning, that 
- only `gsl::owner` is allowed to get `delete`d
- `new` expression must be assigned to `gsl::owner`
- function calls that expect `gsl::owner` as argument, must get either an owner
  or a newly created and recognized resource (in the moment only `new`ed memory)
- assignment to `gsl::owner` must be either a resource or another owner
- functions returning an `gsl::owner` are considered as factories, and their result
  must be assigned to an `gsl::owner`
- classes that have an `gsl::owner`-member must declare a non-default destructor

There are some problems that occur when typededuction is in place.
For example `auto Var = function_that_returns_owner();` the type of `Var` will not be
an `gsl::owner`. This case is catched, and explicitly noted.

But cases like fully templated functions
```
template <typename T> 
void f(T t) { delete t; }
// ...
f(gsl::owner<int*>(new int(42)));
```
Will created false positive (the deletion is problematic), since the type deduction
removes the wrapping `typeAlias`.

Please give your comments :)

llvm-svn: 313043
2017-09-12 16:20:51 +00:00
clang Fix PR34021 test on non-x86 build targets 2017-09-12 15:04:04 +00:00
clang-tools-extra [clang-tidy] Implement type-based check for `gsl::owner` 2017-09-12 16:20:51 +00:00
compiler-rt [libFuzzer] Fix lit files to make running tests more straightforward on Mac OS. 2017-09-12 15:02:10 +00:00
debuginfo-tests Restrict debuginfo-tests to native configurations. 2017-09-08 17:10:48 +00:00
libclc integer: Add popcount implementation using ctpop intrinsic 2017-09-09 02:23:54 +00:00
libcxx Make pbump (internally) handle sizes bigger than MAX_INT. Fixes PR#33725 - thanks to Jonathan Wakely for the report 2017-09-12 15:00:43 +00:00
libcxxabi Revert "[libcxxabi] When built with ASan, __cxa_throw calls __asan_handle_no_return" 2017-09-06 03:00:42 +00:00
libunwind Revert r312240 2017-08-31 15:51:23 +00:00
lld [MIPS] Check raw binary file content instead of disassembled code. NFC 2017-09-12 16:09:42 +00:00
lldb Plugins: fix resolution ambiguity in PDB plugin 2017-09-09 00:13:49 +00:00
llgo irgen: Create functions instead of global variables for builtin hash and equal algorithms. 2017-06-04 22:11:28 +00:00
llvm [SLP] Test with mutiple uses of conditional op and wrong parent. 2017-09-12 16:15:04 +00:00
openmp Read blocktime value set by kmp_set_blocktime() before reading from KMP_BLOCKTIME 2017-09-05 15:45:48 +00:00
parallel-libs [Axccel] Remove -Wno-missing-braces in build 2016-12-19 21:34:07 +00:00
polly Unroll and separate the remaining parts of isolation 2017-09-11 17:46:47 +00:00