[PATCH] D10805: Disabling of "redefine_extname" pragma for C++ code

Richard Smith richard at metafoo.co.uk
Wed Jul 8 14:55:26 PDT 2015


rsmith added a comment.

Just a couple of minor things, otherwise this looks good to me.


================
Comment at: lib/Sema/SemaDecl.cpp:5568
@@ -5570,1 +5567,3 @@
+    return FD->isExternC();
   else if (auto *VD = dyn_cast<VarDecl>(D))
+    return VD->isExternC();
----------------
Drop the `else` here.

================
Comment at: test/CodeGen/redefine_extname.c:29
@@ +28,3 @@
+#pragma redefine_extname foo_static bar_static
+static int foo_static() { return 1; } // expected-warning {{#pragma redefine_extname is applicable to external C declarations only; not applied to function 'foo_static'}}
+int baz() { return foo_static(); }
----------------
This `expected-warning` does nothing, because you don't have a `-verify` RUN: line. This part of the test should be in test/Sema/something.

================
Comment at: test/CodeGenCXX/redefine_extname.cpp:34
@@ +33,3 @@
+#pragma redefine_extname foo_cpp bar_cpp
+extern int foo_cpp() { return 1; } // expected-warning {{#pragma redefine_extname is applicable to external C declarations only; not applied to function 'foo_cpp'}}
+// CHECK-NOT: define i32 @bar_cpp()
----------------
Likewise.


http://reviews.llvm.org/D10805







More information about the cfe-commits mailing list