Warning, /sdk/clazy/tests/copyable-polymorphic/main.cpp.fixed.expected is written in an unsupported language. File is not indexed.
0001
0002
0003 struct ValueClass // OK
0004 {
0005 int m;
0006 };
0007
0008 struct DerivedValueClass : public ValueClass // OK
0009 {
0010 int m;
0011 };
0012
0013 struct PolymorphicClass1 // OK, not copyable
0014 {
0015 virtual void foo();
0016 PolymorphicClass1(const PolymorphicClass1 &) = delete;
0017 PolymorphicClass1& operator=(const PolymorphicClass1 &) = delete;
0018 };
0019
0020 struct PolymorphicClass2 // OK, not copyable
0021 {
0022 virtual void foo();
0023 private:
0024 PolymorphicClass2(const PolymorphicClass2 &);
0025 PolymorphicClass2& operator=(const PolymorphicClass2 &);
0026 };
0027
0028 struct PolymorphicClass3 // OK, not copyable
0029 {
0030 virtual void foo();
0031 PolymorphicClass3(const PolymorphicClass3 &) = delete;
0032 private:
0033 PolymorphicClass3& operator=(const PolymorphicClass3 &) = delete;
0034 };
0035
0036 struct PolymorphicClass4 // Warning, copyable
0037 {
0038 virtual void foo();
0039 PolymorphicClass4(const PolymorphicClass4 &);
0040 PolymorphicClass4& operator=(const PolymorphicClass4 &);
0041 Q_DISABLE_COPY(PolymorphicClass4)
0042 };
0043
0044 struct PolymorphicClass5 // Warning, copyable
0045 {
0046 public:
0047 PolymorphicClass5() = default;
0048 virtual void foo();
0049 Q_DISABLE_COPY(PolymorphicClass5)
0050 };
0051
0052 struct DerivedFromNotCopyable : public PolymorphicClass3 // OK, not copyable
0053 {
0054 };
0055
0056 struct DerivedFromCopyable : public PolymorphicClass4 // Warning, copyable
0057 {
0058 public:
0059 DerivedFromCopyable() = default;
0060 Q_DISABLE_COPY(DerivedFromCopyable)
0061 };
0062
0063 class ClassWithPrivateSection
0064 {
0065 public:
0066 ClassWithPrivateSection() = default;
0067 virtual void foo();
0068 private:
0069 Q_DISABLE_COPY(ClassWithPrivateSection)
0070 void bar();
0071 int i;
0072 };