1 // RUN: %clang_cc1 -fsyntax-only -Wno-dangling-gsl -Wreturn-stack-address -verify %s
3 struct [[gsl::Owner(int)]] MyIntOwner
{
8 struct [[gsl::Pointer(int)]] MyIntPointer
{
9 MyIntPointer(int *p
= nullptr);
10 MyIntPointer(const MyIntOwner
&);
17 return i
; // expected-warning {{reference to stack memory associated with local variable 'i' returned}}
22 return o
; // No warning, it is disabled.