gsl::Owner/gsl::Pointer: Add implicit annotations for some std types
authorMatthias Gehre <M.Gehre@gmx.de>
Wed, 7 Aug 2019 10:45:36 +0000 (10:45 +0000)
committerMatthias Gehre <M.Gehre@gmx.de>
Wed, 7 Aug 2019 10:45:36 +0000 (10:45 +0000)
commit23092ca9bac2b0569ce800dab5c428e1378b6017
tree4788a468318638dd40b3fd154570c56a47cdfdc2
parent30dcae0956112f2333747347650b76405c30a499
gsl::Owner/gsl::Pointer: Add implicit annotations for some std types

Summary:
Hard code gsl::Owner/gsl::Pointer for std types. The paper mentions
some types explicitly. Generally, all containers and their iterators are
covered. For iterators, we cover both the case that they are defined
as an nested class or as an typedef/using. I have started to test this
implementation against some real standard library implementations, namely
libc++ 7.1.0, libc++ 8.0.1rc2, libstdc++ 4.6.4, libstdc++ 4.8.5,
libstdc++ 4.9.4, libstdc++ 5.4.0, libstdc++ 6.5.0, libstdc++ 7.3.0,
libstdc++ 8.3.0 and libstdc++ 9.1.0.

The tests are currently here
  https://github.com/mgehre/llvm-project/blob/lifetime-ci/lifetime-attr-test.sh
  https://github.com/mgehre/llvm-project/blob/lifetime-ci/lifetime-attr-test.cpp
I think due to their dependency on a standard library, they are not a good fit
for clang/test/. Where else could I put them?

Reviewers: gribozavr, xazax.hun

Subscribers: rnkovacs, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64448

llvm-svn: 368147
clang/include/clang/Basic/AttrDocs.td
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaAttr.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaTemplate.cpp
clang/test/SemaCXX/attr-gsl-owner-pointer-std.cpp [new file with mode: 0644]