[PATCH] D91047: Add a call super attribute plugin example

Yafei Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 17 03:54:17 PST 2020


psionic12 marked an inline comment as done.
psionic12 added inline comments.


================
Comment at: clang/test/Frontend/plugin-call-super.cpp:18-19
+struct Derive2 : public Base1, public Base2 { void Test() override {  Base1::Test();  Base2::Test();}};
+// BADCALLSUPER: warning: virtual function 'Base2::Test' is marked as 'call_super' but this overriding method does not call the base version
+// BADCALLSUPER: note: function marked 'call_super' here
+#endif
----------------
aaron.ballman wrote:
> These warnings and notes (and the warning a few lines up) are ones I would have expected to catch using `// expected-warning {{virtual function 'Base2::Test' is marked as 'call_super' but this overriding method does not call the base version}}` style checks instead of needing to use FileCheck.
> 
> Do plugin-based diagnostics not get caught by `-verify`? I expect this test file to fail as currently written because of the `expected-no-diagnostics`, but I've not done a whole lot of testing of plugins before.
`-verify` works well with plugins, I just tested, thanks for pointing out this elegant test way for syntax only features.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91047/new/

https://reviews.llvm.org/D91047



More information about the cfe-commits mailing list