__must_check is a macro mark of function return value. It let developer must check the return value is legal or not.gangliao-patch-1
parent
a405e60253
commit
d76d2febbf
@ -0,0 +1,10 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <paddle/platform/must_check.h>
|
||||
|
||||
int __must_check SomeFunctionMustCheck() { return 0; }
|
||||
|
||||
TEST(MustCheck, all) {
|
||||
// This line should not be compiled, because the
|
||||
// return value of SomeFunctionMustCheck marked as __must_check
|
||||
// SomeFunctionMustCheck();
|
||||
}
|
Loading…
Reference in new issue