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

            Bug ID: 80605
           Summary: Bad is_standard_layout result with empty base classes
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lloda at bluewin dot ch
  Target Milestone: ---

gcc 7.1.0 prints False for the following program. gcc 6.3.0 and others print
True.

// $CXX -std=c++14 -o stdlayout stdlayout.C

#include <iostream>

struct BaseBase {};
struct Base: BaseBase {};
struct Type: public Base { int x; };

int main()
{
    std::cout << std::boolalpha << std::is_standard_layout<Type>::value <<
'\n';
}

Reply via email to