[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / Sema / warn-lifetime-analysis-nocfg-disabled.cpp
blob60b8f3ddedcd1ad9c13101e21715b4bc308fddf6
1 // RUN: %clang_cc1 -fsyntax-only -Wno-dangling-gsl -Wreturn-stack-address -verify %s
3 struct [[gsl::Owner(int)]] MyIntOwner {
4 MyIntOwner();
5 int &operator*();
6 };
8 struct [[gsl::Pointer(int)]] MyIntPointer {
9 MyIntPointer(int *p = nullptr);
10 MyIntPointer(const MyIntOwner &);
11 int &operator*();
12 MyIntOwner toOwner();
15 int &f() {
16 int i;
17 return i; // expected-warning {{reference to stack memory associated with local variable 'i' returned}}
20 MyIntPointer g() {
21 MyIntOwner o;
22 return o; // No warning, it is disabled.