brintos

brintos / llvm-project-archived public Read only

0
0
Text · 902 B · b8e27f8 Raw
33 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-linux-pc -DIS64 -fsyntax-only -verify -std=c++17 %s 2// RUN: %clang_cc1 -triple x86_64-windows-pc -DIS64 -fsyntax-only -verify -std=c++17 %s3// RUN: %clang_cc1 -triple i386-linux-pc -fsyntax-only -verify -std=c++17 %s4// RUN: %clang_cc1 -triple i386-windows-pc -DW32 -fsyntax-only -verify -std=c++17 %s5// expected-no-diagnostics6 7struct Base {};8struct A : virtual Base {9  virtual void n() {}10};11 12auto p = &A::n;13static_assert(__has_unique_object_representations(decltype(p)));14 15struct B {16  decltype(p) x;17  int b;18#ifdef IS6419  // required on 64 bit to fill out the tail padding.20  int c;21#endif22};23static_assert(__has_unique_object_representations(B));24 25struct C { // has padding on Win32, but nothing else.26  decltype(p) x;27};28#ifdef W3229static_assert(!__has_unique_object_representations(C));30#else31static_assert(__has_unique_object_representations(C));32#endif33