File indexing completed on 2024-05-05 05:41:40
0001 #include <QtCore/QObject> 0002 0003 0004 0005 struct HasDtor // Warning 0006 { 0007 ~HasDtor() { int a; } 0008 }; 0009 0010 struct HasDtorAndCopyCtor // Warning 0011 { 0012 HasDtorAndCopyCtor(const HasDtorAndCopyCtor &) {} 0013 ~HasDtorAndCopyCtor() {} 0014 }; 0015 0016 struct HasDtorAndCopyCtorAndAssign // OK 0017 { 0018 HasDtorAndCopyCtorAndAssign(const HasDtorAndCopyCtorAndAssign &) {} 0019 ~HasDtorAndCopyCtorAndAssign() {} 0020 HasDtorAndCopyCtorAndAssign& operator=(const HasDtorAndCopyCtorAndAssign &) { return *this; } 0021 }; 0022 0023 struct HasNothing // OK 0024 { 0025 }; 0026 0027 struct HasCopyCtor // Warning 0028 { 0029 HasCopyCtor() {} 0030 HasCopyCtor(const HasCopyCtor &) {} 0031 }; 0032 0033 struct HasDefaults // OK 0034 { 0035 HasDefaults(const HasDefaults &) = default; 0036 ~HasDefaults() = default; 0037 HasDefaults& operator=(const HasDefaults &) = default; 0038 }; 0039 0040 struct HasOnlyDTOROnPurpose // OK 0041 { 0042 ~HasOnlyDTOROnPurpose(); 0043 private: 0044 HasOnlyDTOROnPurpose(const HasOnlyDTOROnPurpose &) = delete; 0045 HasOnlyDTOROnPurpose& operator=(const HasOnlyDTOROnPurpose &) = delete; 0046 }; 0047 0048 struct HasOnlyDTOROnPurpose2; // OK 0049 0050 struct HasOnlyDTOROnPurpose2 // OK 0051 { 0052 ~HasOnlyDTOROnPurpose2(); 0053 private: 0054 Q_DISABLE_COPY(HasOnlyDTOROnPurpose2) 0055 }; 0056 0057 struct HasNothingButNested // OK 0058 { 0059 HasNothingButNested() {} 0060 HasCopyCtor c; 0061 }; 0062 0063 struct Has3ButDtorDefault 0064 { 0065 ~Has3ButDtorDefault() = default; 0066 Has3ButDtorDefault(const Has3ButDtorDefault &); 0067 Has3ButDtorDefault& operator=(const Has3ButDtorDefault &); 0068 }; 0069 0070 struct HasEmptyDtor 0071 { 0072 ~HasEmptyDtor() {} // OK 0073 };