[PATCH] D64256: Teach some warnings to respect gsd::Pointer and gsl::Owner attributes

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 5 10:51:03 PDT 2019


xazax.hun created this revision.
xazax.hun added reviewers: mgehre, rsmith, gribozavr.
Herald added subscribers: cfe-commits, Charusso, gamesh411, Szelethus, dkrupp, rnkovacs.
Herald added a project: clang.

This patch extends some existing warnings to utilize the knowledge about the gsl::Pointer and gsl::Owner attributes.

The implicit assumption of this patch is that if a class annotated with gsl::Pointer is created from a gsl::Owner (through conversion operator or a constructor taking the owner as the first argument) the Pointer will point to the buffer of the Owner, so it will dangle after the lifetime of the Owner ends.


Repository:
  rC Clang

https://reviews.llvm.org/D64256

Files:
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Sema/SemaInit.cpp
  clang/test/Sema/warn-lifetime-analysis-nocfg.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64256.208206.patch
Type: text/x-patch
Size: 12445 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190705/c163bdff/attachment-0001.bin>


More information about the cfe-commits mailing list