aboutsummaryrefslogtreecommitdiffstats
path: root/tests/qrequiredresult-candidates/main.cpp
blob: 9c824cc00a8458e07be4a8f5a275278a5fcad935 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include <QtCore/QObject>
#include <QtCore/QString>
class Foo
{
public:
    Foo();
    Foo& operator=(Foo&);
    Foo& change();
    Foo changed() const; // Warn
    Foo chang2ed() const { return *this; }  // Warn
    Foo chang3ed() const; // Warn

    [[nodiscard]] Foo chang4ed() const;
    Foo toBar() const;
private:
    Foo chang5ed() const { return *this; }

    class Bar {
    public:
        Bar changed() const { return *this; }
    };
};

Foo Foo::chang3ed() const // OK
{
    return *this;
}