[llvm-bugs] [Bug 26022] New: Error on valid use of init_priority attribute

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Jan 4 17:26:14 PST 2016


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

            Bug ID: 26022
           Summary: Error on valid use of init_priority attribute
           Product: clang
           Version: 3.7
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: marksan at fb.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Clang rejects this application of attribute(init_priority(N)) where GCC accepts
it.  The source seems valid to me:

     template< typename T >
     struct A {};

     template< typename T >
     struct B
     {
       static A<T> a;
     };

     template< typename T >
     A<T> B<T>::a __attribute__((__init_priority__(300)));

The error is:
     error: can only use 'init_priority' attribute on file-scope definitions of
objects of class type

-- 
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/20160105/bcd35342/attachment.html>


More information about the llvm-bugs mailing list