[llvm-bugs] [Bug 28571] New: Binding references to data members of packed class types is not diagnosed

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 15 02:30:17 PDT 2016


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

            Bug ID: 28571
           Summary: Binding references to data members of packed class
                    types is not diagnosed
           Product: clang
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: roger.ferreribanez at arm.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

GCC as of 4.7 diagnoses binding references to members of packed class types as
an error.

  // test.cc
  struct __attribute__((packed)) A
  {
      int y;
  } a;

  int &ry = a.y;
  // end of test.cc

$ g++ -c test.cc
test.cc:7:13: error: cannot bind packed field ‘a.A::y’ to ‘int&’
 int &ry = a.y;

For better compatibility with GCC, clang should emit a diagnostic for such case
(not necessarily an error like GCC does).

-- 
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/20160715/d7fb9cf9/attachment.html>


More information about the llvm-bugs mailing list