Issue |
156453
|
Summary |
[clang-tidy] Add check to catch undefined behavior when using GMock
|
Labels |
clang-tidy,
check-request
|
Assignees |
|
Reporter |
carlosgalvezp
|
The [docs](https://google.github.io/googletest/gmock_for_dummies.html#expectation-ordering) of GMock say:
> Important note: gMock requires expectations to be set before the mock functions are called, otherwise the behavior is undefined. Do not alternate between calls to EXPECT_CALL() and calls to the mock functions, and do not set any expectations on a mock after passing the mock to an API.
It would would to have a clang-tidy check detecting these instances of UB. It would fit well in the `google` module, where there's already e.g. `google-readability-avoid-underscore-in-googletest-name`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs