https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83732

            Bug ID: 83732
           Summary: wrong warning about non-POD field
           Product: gcc
           Version: 7.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stsp at users dot sourceforge.net
  Target Milestone: ---

Created attachment 43055
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43055&action=edit
test-case

The attached test-case demonstrates the problem:
---
$ LC_ALL=C g++ -Wall pod.cpp 
pod.cpp:11:16: warning: ignoring packed attribute because of unpacked non-POD
field 'ttt tst::a'
     struct ttt a;
$ ./a.out
size1=5 size2=8
---

As can be seen from the output, the attribute was
actually not ignored. I actually think there are
no non-POD members, so the warning is spurious and
the resulting code is correct. And indeed, clang++
generates no such warning and the packing works fine
there too.

Reply via email to