| // 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 CHECK |
| // 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 |
| // 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 |
| // 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 |
| // 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 |
| // 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 |
| // 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 |
| |
| #if __cplusplus == 199711L |
| #define NOTHROW throw() |
| #else |
| #define NOTHROW noexcept(true) |
| #endif |
| |
| namespace cwg199 { // cwg199: 2.8 |
| struct A { |
| ~A() NOTHROW {} |
| }; |
| |
| struct B { |
| ~B() NOTHROW {} |
| }; |
| |
| void foo() { |
| A(), B(); |
| } |
| |
| // CHECK-LABEL: define {{.*}} void @cwg199::foo() |
| // CHECK-NOT: call void @cwg199::A::~A() |
| // CHECK: call void @cwg199::B::~B() |
| // CHECK: call void @cwg199::A::~A() |
| // CHECK-LABEL: } |
| } // namespace cwg199 |