Menu

BUG: Internal error. Token::astOperand2() cyclic dependency.

Dan-42
2021-06-05
2021-06-09
  • Dan-42

    Dan-42 - 2021-06-05

    The following code:

    #include <map>
    
    struct test {
      enum key { a,b };
      explicit test(key k) {}
    };
    
    auto create_tests() {
      return std::map<int, test> {
            {1, test{test::a}}
      , {2, test{test::b}}  };
    }
    

    causes this error:

    cppcheck_test.cpp:11:29: error: Internal error. Token::astOperand2() cyclic dependency. [cppcheckError]
      return std::map<int, test>{
    

    I do not have a trac account (I think), so I post it here.
    depending on my spare time, I will try to fix it myself.

    The code is over simplified, but basically the enum is passed in so it's members are initialized accordingly to the enum.

     
  • Daniel Marjamäki

    Thanks! For some reason, I fail to reproduce.

     

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.