brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 33ea179 Raw
41 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 CHECK3// 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 CHECK4// 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 CHECK5// 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 CHECK6// 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 CHECK7// We aren't testing this since C++26 because of P2748R5 "Disallow Binding a Returned Glvalue to a Temporary".8 9#if __cplusplus == 199711L10#define NOTHROW throw()11#else12#define NOTHROW noexcept(true)13#endif14 15namespace cwg650 { // cwg650: 2.816 17struct Q {18  ~Q() NOTHROW;19};20 21struct R {22  ~R() NOTHROW;23};24 25struct S {26  ~S() NOTHROW;27};28 29const S& f() {30  Q q;31  return (R(), S());32}33 34} // namespace cwg65035 36// CHECK-LABEL: define {{.*}} @cwg650::f()()37// CHECK:         call void @cwg650::S::~S()38// CHECK:         call void @cwg650::R::~R()39// CHECK:         call void @cwg650::Q::~Q()40// CHECK-LABEL: }41