brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 535ef9b Raw
38 lines · cpp
1// RUN: %clang_cc1 -std=c++98 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK2// RUN: %clang_cc1 -std=c++11 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK,SINCE-CXX113// RUN: %clang_cc1 -std=c++14 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK,SINCE-CXX114// RUN: %clang_cc1 -std=c++17 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK,SINCE-CXX115// RUN: %clang_cc1 -std=c++20 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK,SINCE-CXX116// RUN: %clang_cc1 -std=c++23 %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK,SINCE-CXX117// RUN: %clang_cc1 -std=c++2c %s -triple x86_64-linux-gnu -emit-llvm -o - -fexceptions -fcxx-exceptions -pedantic-errors | llvm-cxxfilt -n | FileCheck %s --check-prefixes CHECK,SINCE-CXX118 9namespace cwg2504 { // cwg2504: no10#if __cplusplus >= 201103L11struct V { V() = default; V(int); };12struct Q { Q(); };13struct A : virtual V, Q {14  using V::V;15  A() = delete;16};17int bar() { return 42; }18struct B : A {19  B() : A(bar()) {}  // ok20};21struct C : B {};22void foo() { C c; } // bar is not invoked, because the V subobject is not initialized as part of B23#endif24} // namespace cwg250425 26// FIXME: As specified in the comment above (which comes from an example in the Standard),27//        we are not supposed to unconditionally call `bar()` and call a constructor28//        inherited from `V`.29 30// SINCE-CXX11-LABEL: define linkonce_odr void @cwg2504::B::B()31// SINCE-CXX11-NOT:     br32// SINCE-CXX11:         call noundef i32 @cwg2504::bar()33// SINCE-CXX11-NOT:     br34// SINCE-CXX11:         call void @cwg2504::A::A(int)35// SINCE-CXX11-LABEL: }36 37// CHECK: {{.*}}38