{"push_id":628076486,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"4312e6cd4678cb58f0f3ba0cd035f1a8263738b6","before":"8b96f9be9c7718b33199b69d26c6d686050b716e","commits":[{"sha":"4312e6cd4678cb58f0f3ba0cd035f1a8263738b6","author":{"email":"856af8c1da1fc09fe3a5b132b1e3446ca8cb4381@google.com","name":"Kaelyn Takata"},"message":"Properly implement warn_unused_result checking for classes/structs.\n\nThe previous implementation would copy the attribute from the class to\nfunctions that have the class as their return type when the functions\nare first declared. This proved to have two flaws:\n  1) if the class is forward-declared without the attribute and a\n     function or method with the class as a its return type is declared,\n     and afterward the class is defined with warn_unused_result, the\n     function or method would never inherit the attribute, and\n  2) the check simply failed for functions and methods that are part of\n     a template instantiation, regardless of whether the class with\n     warn_unused_result is part of a specific instantiation or part of\n     the template itself (presumably because those function/method\n     declaration does not hit the same code path as a non-template one\n     and so never inherits the attribute).\n\nThe new approach is to instead modify the two places where a function or\nmethod call is checked for the warn_unused_result attribute on the decl\nby extending the checks to also look for the attribute on the decl's\nreturn type.\n\nAdditionally, the check for return types that have the warn_unused_result\nnow excludes pointers and references to such types, as such return types do\nnot necessarily imply a transfer of ownership for the underlying object\nbeing referred to by the return value. This does not change the behavior\nof functions that are directly given the warn_unused_result attribute.","distinct":true,"url":"https://api.github.com/repos/llvm-project/llvm-project/commits/4312e6cd4678cb58f0f3ba0cd035f1a8263738b6"}]}