[PATCH] D22113: C does not have inline variables

Paul Robinson via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 14 15:18:38 PDT 2016

probinson marked an inline comment as done.

Comment at: lib/Sema/SemaDecl.cpp:6189-6191
@@ -6188,2 +6188,5 @@
         << FixItHint::CreateRemoval(D.getDeclSpec().getInlineSpecLoc());
+    } else if (!getLangOpts().CPlusPlus) {
+      Diag(D.getDeclSpec().getInlineSpecLoc(), diag::err_inline_non_function)
+          << 0;
     } else {
majnemer wrote:
> I'd suggest sorting this condition higher.  It doesn't make much sense to mention block scopes when inline variables are prohibited in all contexts in C.
Right... for some reason the word 'block' in the comment made me think it was an Objective-C thing.  The C-language check is first now.


More information about the cfe-commits mailing list