http://llvm.org/bugs/show_bug.cgi?id=20679

            Bug ID: 20679
           Summary: GNU-style attributes in incorrect position
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

According to the GCC documentation
(https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html#Attribute-Syntax):
---
For example,

     void (__attribute__((noreturn)) ****f) (void);
specifies the type “pointer to pointer to pointer to pointer to non-returning
function returning void”. As another example,

     char *__attribute__((aligned(8))) *f;
specifies the type “pointer to 8-byte-aligned pointer to char”. Note again that
this does not work with most attributes; for example, the usage of ‘aligned’
and ‘noreturn’ attributes given above is not yet supported.
---
If we wish to implement the documented (expected) behavior, we may need to
diagnose situations where GNU-style attribute placement laxity is currently
allowed. For instance, the aligned example above currently places the attribute
on the variable declaration instead of on the type, as expected.

So attributes in type position which apply only to declarations should warn and
attributes in declaration position which only apply to types should warn.

See further discussion in:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140811/112661.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to