[PATCH] Treat inline function declarations in -fms-extensions as if it were in C++ when in C mode.

Reid Kleckner rnk at google.com
Thu Aug 1 09:19:02 PDT 2013

  LGTM with the switch to fms-compatibility.

  I basically wrote the same patch without tests before I went home yesterday.  :)

Comment at: lib/AST/ASTContext.cpp:7811
@@ +7810,3 @@
+  if ((!getLangOpts().CPlusPlus && !getLangOpts().MicrosoftExt) ||
+      FD->hasAttr<GNUInlineAttr>()) {
Eli changed the bug to say this should check for -fms-compatibility, which is MicrosoftMode here.

I always forget the distinction and want to update the docs to make it clearer.

Comment at: test/CodeGen/inline.c:55
@@ +54,3 @@
+// RUN: echo "MS C Extensions tests:"
+// RUN: %clang %s -target i386-unknown-unknown -O1 -emit-llvm -S -o - -std=c99 -fms-extensions | FileCheck %s --check-prefix=CHECK4
+// CHECK4: define i32 @bar()


More information about the cfe-commits mailing list