[llvm-bugs] [Bug 39747] New: Visibility attribute is ignored on definition

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Nov 21 15:38:02 PST 2018


            Bug ID: 39747
           Summary: Visibility attribute is ignored on definition
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ldionne at apple.com
                CC: htmldeveloper at gmail.com, llvm-bugs at lists.llvm.org,
                    neeilans at live.com, richard-llvm at metafoo.co.uk

In the following code, hidden visibility is not given to `Foo<int>::bar(int)`
even though an explicit visibility attribute is used:

#define HIDDEN __attribute__((visibility("hidden")))

template <class T>
struct Foo {
    template <class U>
    HIDDEN void bar(U) {}

    void baz() { bar(42); }

template struct Foo<int>;

Live example: https://godbolt.org/z/BX7nfz

Thanks to Eric Fiselier for the reproducer.

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20181121/5f4b2096/attachment.html>

More information about the llvm-bugs mailing list