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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Testcase without includes:
typedef __SIZE_TYPE__ size_t;
template <typename T, size_t N>
constexpr size_t size (const T (&)[N]) noexcept { return N; }
#pragma pack(1)
struct S1 { int i[10]; };
#pragma pack()
struct __attribute__((packed)) S2 { int i[10]; };
#define LEN(a) (sizeof(a) / sizeof(a[0]));

size_t
foo ()
{
  S1 s1{};
  constexpr auto sz1 = size (s1.i);
  S2 s2{};
  constexpr auto sz2 = size (s2.i);
  constexpr auto sz3 = LEN(s2.i);
  return sz1 + sz2 + sz3;
}

Reply via email to