Skip to content

Possible dangling reference to a temporary

/home/user/Code/libkazv/src/client/actions/auth.cpp: In function ‘Kazv::ClientResult Kazv::processResponse(ClientModel, Api::LoginResponse)’:
/home/user/Code/libkazv/src/client/actions/auth.cpp:41:21: warning: possibly dangling reference to a temporary [-Wdangling-reference]
   41 |         const json &j = r.jsonBody().get();
      |                     ^
/home/user/Code/libkazv/src/client/actions/auth.cpp:41:41: note: the temporary was destroyed at the end of the full expression ‘Kazv::Response::jsonBody() const().Kazv::JsonWrap::get()’
   41 |         const json &j = r.jsonBody().get();
      |                         ~~~~~~~~~~~~~~~~^~