CLion, Incorrect "Pragma diagnostic pop could not pop, no matching push" inspection warning
I recently updated my Clion to 2018.2. Now every .cpp/.h file where I have a
#pragma clang diagnostic pop
at the end of the file, I am getting a "Pragma diagnostic pop could not pop, no matching push" inspection warning. I have checked and double checked and I am certain that my those statements are balanced and correct. This is happening in every file where the #pragma clang diagnostic pop is at the end of the file. My typical use case is to have the the push at the top of a file like so:
#pragma clang diagnostic push
#pragma ide diagnostic ignored "OCUnusedStructInspection"
#pragma ide diagnostic ignored "CannotResolve"
followed my all my code, then at the end of the file have the following:
#pragma clang diagnostic pop
In most cases Clion inserted these statements as I disabled certain inspections for an entire file.
This always happens with the last pop statement in the file where the push is at the beginning of the file. Any push/pop statements within the body seem to work fine.
Thanks,
Craig
请先登录再写评论。
Hello! Sorry for the inconvenience. We have a related issue in our tracker: https://youtrack.jetbrains.com/issue/CPP-13405. Feel free to comment or upvote in order to get updates.
Meanwhile you can disable options in File | Settings | Languages & Frameworks | C/C++ | Clangd as a workaround.
Thanks Anna for your response. I did up vote the issue and look forward to it being resolved in a future release.