1ed128c7dSVlad Serebrennikov // 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
2ed128c7dSVlad Serebrennikov // 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
3ed128c7dSVlad Serebrennikov // 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
4ed128c7dSVlad Serebrennikov // 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
5ed128c7dSVlad Serebrennikov // 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
6ed128c7dSVlad Serebrennikov // 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
7*e7184030Syronglin // We aren't testing this since C++26 because of P2748R5 "Disallow Binding a Returned Glvalue to a Temporary".
8ed128c7dSVlad Serebrennikov
9ed128c7dSVlad Serebrennikov #if __cplusplus == 199711L
10ed128c7dSVlad Serebrennikov #define NOTHROW throw()
11ed128c7dSVlad Serebrennikov #else
12ed128c7dSVlad Serebrennikov #define NOTHROW noexcept(true)
13ed128c7dSVlad Serebrennikov #endif
14ed128c7dSVlad Serebrennikov
15ed128c7dSVlad Serebrennikov namespace cwg650 { // cwg650: 2.8
16ed128c7dSVlad Serebrennikov
17ed128c7dSVlad Serebrennikov struct Q {
18ed128c7dSVlad Serebrennikov ~Q() NOTHROW;
19ed128c7dSVlad Serebrennikov };
20ed128c7dSVlad Serebrennikov
21ed128c7dSVlad Serebrennikov struct R {
22ed128c7dSVlad Serebrennikov ~R() NOTHROW;
23ed128c7dSVlad Serebrennikov };
24ed128c7dSVlad Serebrennikov
25ed128c7dSVlad Serebrennikov struct S {
26ed128c7dSVlad Serebrennikov ~S() NOTHROW;
27ed128c7dSVlad Serebrennikov };
28ed128c7dSVlad Serebrennikov
f()29ed128c7dSVlad Serebrennikov const S& f() {
30ed128c7dSVlad Serebrennikov Q q;
31ed128c7dSVlad Serebrennikov return (R(), S());
32ed128c7dSVlad Serebrennikov }
33ed128c7dSVlad Serebrennikov
34ed128c7dSVlad Serebrennikov } // namespace cwg650
35ed128c7dSVlad Serebrennikov
36ed128c7dSVlad Serebrennikov // CHECK-LABEL: define {{.*}} @cwg650::f()()
37ed128c7dSVlad Serebrennikov // CHECK: call void @cwg650::S::~S()
38ed128c7dSVlad Serebrennikov // CHECK: call void @cwg650::R::~R()
39ed128c7dSVlad Serebrennikov // CHECK: call void @cwg650::Q::~Q()
40ed128c7dSVlad Serebrennikov // CHECK-LABEL: }
41