summaryrefslogblamecommitdiff
path: root/test/test11.cpp
blob: 7e4fd2ac69017c4cb3776fd8ff83ad949635d1c7 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                        
                                      



                   
                        



                                        





















                                        
         




                        





















                                                                       
  
class Data1
{
    public:
        int val;
};

class Object1
{
    int k;

    void func1(Data1 *ptr1, Data1 *ptr2)
    {
        if (!ptr1 || ptr1->val == 100)
        {
            return;
        }

        ptr1->val = 200;
    }

    void func2(Data1 *ptr1, Data1 *ptr2)
    {
        if (ptr1 && ptr1->val == 100)
        {
            ptr1->val = 200;
            return;
        }

        ptr1->val = 300;
    }

    void func3(Data1 *ptr1, Data1 *ptr2)
    {
        if (ptr1 || ptr1->val == 100)
        {
            return;
        }

        ptr1->val = 200;
    }

    void func4(Data1 *ptr1, Data1 *ptr2)
    {
        if (!ptr1 && ptr1->val == 100)
        {
            return;
        }

        ptr1->val = 200;
    }

    void func5(Data1 *ptr1, Data1 *ptr2)
    {
        if ((!ptr1 || ptr1->val == 100) || (!ptr2 || ptr2->val == 200))
        {
            return;
        }

        ptr1->val = 300;
        ptr2->val = 400;
    }

    void func6(Data1 *ptr1, Data1 *ptr2)
    {
        if ((!ptr1 || ptr1->val == 100) && (!ptr2 || ptr2->val == 200))
        {
            return;
        }

        ptr1->val = 300;
        ptr2->val = 400;
    }
};