This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/83374] New: Bad std::is_standard_layout with two base class subobjects of the same type


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

            Bug ID: 83374
           Summary: Bad std::is_standard_layout with two base class
                    subobjects of the same type
           Product: gcc
           Version: 6.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alex.mikhalevich at gmail dot com
  Target Milestone: ---

Steps to reproduce:
1. Compile the following code with gcc 6.3.0 (maybe affects other versions, I
was not able to check):
#include <iostream>
#include <type_traits>

struct Q {};
struct S : Q {};
struct T : Q {};
struct NonPod : S, T {};
int main(int argc, char** argv) {
        std::cout << (bool)std::is_pod<NonPod>::value << " ";
        std::cout << (bool)std::is_standard_layout<NonPod>::value << std::endl;
        return 0;
}
2. Run the result program.

Expected result:
0 0 (the NonPod structure is not a standard-layout class as described here:
http://en.cppreference.com/w/cpp/concept/StandardLayoutType).

Actual result:
1 1

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]