[PATCH] D106732: Support macro deprecation #pragma clang deprecated

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 28 12:01:22 PDT 2021


aaron.ballman added inline comments.


================
Comment at: clang/test/Lexer/deprecate-macro.c:34-39
+#ifdef foo
+#endif
+
+// expected-warning at +1{{macro 'foo' has been marked as deprecated}}
+#ifndef foo
+#endif
----------------
Some more test cases to add:
```
// Test that we diagnose on #elifdef.
#ifdef baz
#elifdef foo // expected-warning
#endif

// Test that we diagnose on #elifndef.
#ifdef baz
#elifndef foo // expected-warning
#endif

// Test that we diagnose both the taken branch and the skipped branch.
#ifdef foo // expected-warning
#elifdef bar // expected-warning
#endif
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106732



More information about the cfe-commits mailing list