================ @@ -19,8 +19,10 @@ namespace usage_invalid { namespace usage_ok { struct IntRef { int *target; }; + const int *defaultparam(const int &def1 [[clang::lifetimebound]] = 0); // #def1 int &refparam(int ¶m [[clang::lifetimebound]]); int &classparam(IntRef param [[clang::lifetimebound]]); + const int *c = defaultparam(); // expected-warning {{temporary whose address is used as value of local variable 'c' will be destroyed at the end of the full-expression}} expected-note@#def1 {{default argument declared here}} ---------------- higher-performance wrote:
Done, thanks! https://github.com/llvm/llvm-project/pull/112047 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits