layout" rules. The new rules say that a standard-layout struct has its first non-static data member and all base classes at offset 0, and consider a class to not be standard-layout if that would result in multiple subobjects of a single type having the same address. We track "is C++11 standard-layout class" separately from "is standard-layout class" so that the ABIs that need this information can still use it. Differential Revision: https://reviews.llvm.org/D45176 llvm-svn: 329332
18 lines
923 B
C++
18 lines
923 B
C++
// RUN: %clang_cc1 -std=c++98 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
|
|
// RUN: %clang_cc1 -std=c++11 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
|
|
// RUN: %clang_cc1 -std=c++14 -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
|
|
// RUN: %clang_cc1 -std=c++1z -triple x86_64-unknown-unknown %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
|
|
|
|
namespace dr2229 { // dr2229: 7
|
|
struct AnonBitfieldQualifiers {
|
|
const unsigned : 1; // expected-error {{anonymous bit-field cannot have qualifiers}}
|
|
volatile unsigned : 1; // expected-error {{anonymous bit-field cannot have qualifiers}}
|
|
const volatile unsigned : 1; // expected-error {{anonymous bit-field cannot have qualifiers}}
|
|
|
|
unsigned : 1;
|
|
const unsigned i1 : 1;
|
|
volatile unsigned i2 : 1;
|
|
const volatile unsigned i3 : 1;
|
|
};
|
|
}
|