brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · b514449 Raw
91 lines · c
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef TEST_META_UNARY_COMP_COMMON_H10#define TEST_META_UNARY_COMP_COMMON_H11 12#include "test_macros.h"13 14#if TEST_STD_VER >= 1115struct TrivialNotNoexcept {16  TrivialNotNoexcept() noexcept(false)                                     = default;17  TrivialNotNoexcept(const TrivialNotNoexcept&) noexcept(false)            = default;18  TrivialNotNoexcept(TrivialNotNoexcept&&) noexcept(false)                 = default;19  TrivialNotNoexcept& operator=(const TrivialNotNoexcept&) noexcept(false) = default;20  TrivialNotNoexcept& operator=(TrivialNotNoexcept&&) noexcept(false)      = default;21};22#endif23 24class Empty {};25 26struct NotEmpty {27  virtual ~NotEmpty();28};29 30union Union {};31 32struct bit_zero {33  int : 0;34};35 36struct A {37  A();38  A(const A&);39  A& operator=(const A&);40};41 42class Abstract {43  virtual ~Abstract() = 0;44};45 46// Types for reference_{constructs/converts}_from_temporary47 48#if TEST_STD_VER >= 2349 50class NonPODClass {51public:52  NonPODClass(int);53};54enum Enum { EV };55struct Base {56  Enum e;57  int i;58  float f;59  NonPODClass* p;60};61// Not PODs62struct Derived : Base {};63 64template <class T, class RefType = T&>65class ConvertsToRef {66public:67  operator RefType() const { return static_cast<RefType>(obj); }68  mutable T obj = 42;69};70template <class T, class RefType = T&>71class ConvertsToRefPrivate {72  operator RefType() const { return static_cast<RefType>(obj); }73  mutable T obj = 42;74};75 76class ExplicitConversionRvalueRef {77public:78  operator int();79  explicit operator int&&();80};81 82class ExplicitConversionRef {83public:84  operator int();85  explicit operator int&();86};87 88#endif89 90#endif // TEST_META_UNARY_COMP_COMMON_H91