================ @@ -28,4 +36,28 @@ void *foo() { return RA<2>(); // expected-note{{in instantiation of function template specialization 'RA<2>' requested here}} } -#endif + +void* f() { + return ([&] () { + return __builtin_frame_address(0); // expected-warning{{calling '__builtin_frame_address' in function not marked __attribute__((noinline)) may return a caller's frame address}} + })(); +} + +void* g() { + return ([&] () __attribute__((noinline)) { + return __builtin_frame_address(0); + })(); +} + +void* h() { + return ([&] () { + return __builtin_return_address(0); // expected-warning{{calling '__builtin_return_address' in function not marked __attribute__((noinline)) may return a caller's return address}} + })(); +} + +void* i() { + return ([&] () __attribute__((noinline)) { + return __builtin_return_address(0); + })(); +} +#endif ---------------- AaronBallman wrote:
Please add the newline back to the end of the file. https://github.com/llvm/llvm-project/pull/82966 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits