https://bugs.llvm.org/show_bug.cgi?id=35863

            Bug ID: 35863
           Summary: explicit specialization of variable template has wrong
                    behavior regarding 'static'
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++14
          Assignee: unassignedclangb...@nondot.org
          Reporter: richard-l...@metafoo.co.uk
                CC: llvm-bugs@lists.llvm.org

Case #1:

template<int> static int n;
template<> int n<0>;

Case #2:

template<int> int n;
template<> static int n<0>;

Case #3:

template<int> static int n;
template<> static int n<0>;


For case #1, clang should treat n<0> as being an internal-linkage variable, but
it actually gives it external linkage.

For case #2 and #3, clang should reject ([dcl.stc]p3: A storage-class-specifier
other than thread_local shall not be specified in an explicit specialization).

We appear to get this right for function templates and for explicit
instantiations of variable templates.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to