Bug ID: 30695
           Summary: Templated method inside a templated class ignores
                    visibility attribute
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
    Classification: Unclassified

Created attachment 17441
Code which repros the bug.

When compiling with either `-fvisibility=hidden` or
`-fvisibility-inlines-hidden`, templated class methods inside a templated class
do not respect the visibility attribute (e.g.
`__attribute__((visibility("default")))`) and remain hidden.

Repro code:

template<typename T>
class A {
  int a;
  template<typename C>
  __attribute__ ((visibility ("default")))
  static void foo() {}

void func() {

Then run, on the above code:
$ clang  -c -fvisibility=hidden -o test.o test.cpp
$ readelf -s test.o  # shows `void A<int>::foo<int>()` is HIDDEN

You are receiving this mail because:
You are on the CC list for the bug.
llvm-bugs mailing list

Reply via email to