[PATCH] PR22419

Richard Smith richard at metafoo.co.uk
Tue Feb 3 15:34:24 PST 2015


================
Comment at: lib/AST/Decl.cpp:669-674
@@ -668,3 +668,8 @@
       if (computation == LVForValue) {
-        globalVisibility = Context.getLangOpts().getValueVisibilityMode();
+        const FunctionDecl *FD = D->getAsFunction();
+        if (FD && FD->getCorrespondingUnsizedGlobalDeallocationFunction())
+          // C++14's implicit sized deallocation functions always have default visibility.
+          globalVisibility = DefaultVisibility;
+        else
+          globalVisibility = Context.getLangOpts().getValueVisibilityMode();
       } else {
----------------
I would prefer to handle this by adding a visibility(default) attribute to all implicitly-declared allocation functions in `Sema::DeclareGlobalAllocationFunction`.

http://reviews.llvm.org/D7392

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list