================
@@ -88,12 +91,14 @@ void 
RedundantInlineSpecifierCheck::registerMatchers(MatchFinder *Finder) {
         this);
 
   if (getLangOpts().CPlusPlus17) {
-    Finder->addMatcher(
-        varDecl(isInlineSpecified(),
-                anyOf(isInternalLinkage(StrictMode),
-                      allOf(isConstexpr(), hasAncestor(recordDecl()))))
-            .bind("var_decl"),
-        this);
+    const auto IsPartOfRecordDecl = hasAncestor(recordDecl());
+    Finder->addMatcher(varDecl(isInlineSpecified(),
+                               anyOf(allOf(isInternalLinkage(StrictMode),
+                                           unless(allOf(hasInitialization(),
----------------
felix642 wrote:

I thought about this, but I can't find an example where a class member would 
have the inline keyword and not be static.
If you look at the test case I added, the static keyword is required for the 
code to compile otherwise you will get a compilation error saying that inline 
can only appear on non-local variable (Which makes sense tbf).

Do you have an example in mind where the inline keyword is used on non-static 
class member? 

godbolt: https://godbolt.org/z/aEGGvs9Kc

https://github.com/llvm/llvm-project/pull/81423
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to