Menu

FP: knownConditionTrueFalse does not account for possible exception

2020-04-22
2020-04-22
  • Paul Cornett

    Paul Cornett - 2020-04-22

    Regression since 1.90:

    void g1();
    void g2();
    void g3();
    void f()
    {
            bool b = false;
            try {
                    g1();
                    b = true;
                    g2();
            }
            catch (...) {
                    if (b) {
                            g3();
                    }
            }
    }
    

    t.cpp:13:7: note: Condition 'b' is always true

     
  • versat

    versat - 2020-04-22

    Thank you for reporting this, I will create a ticket.

    EDIT:
    Created ticket: https://trac.cppcheck.net/ticket/9687 (closed as duplicate)

     

    Last edit: versat 2020-04-22
  • Daniel Marjamäki

    Thanks!

    I created this ticket: https://trac.cppcheck.net/ticket/9686#ticket

    Very nice catch that you found this regression before release. 👍

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.