Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-18475

Clang Code Model doesn't follow signatures with arguments differing in constness

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • Qt Creator 3.6.0, Qt Creator 4.0.0, Qt Creator 4.1.0, Qt Creator 4.2.0, Qt Creator 4.3.0
    • C/C++/Obj-C++ Support
    • None

    Description

      Declaring a function in a header such as:

      void f(int x);

      And defining it in a cpp file as:

      void f(const int x) {}
      

      Makes the clang code model lost. "Switching between declaration/definition" doesn't work. "Follow symbol under cursor" works from definition to declaration but not the other way around.

      This problem does not impact the Qt Creator old code model.

      This is valid C++ code and commonly used to tell the compiler that the copy of x will not be modified, without overwhelming the API user with implementation details. 

      Thank you,

      Ben.

       

       

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-18475
        # Subject Branch Project Status CR V

        Activity

          People

            yvvan Ivan Donchevskii
            benoit.bleuze Benoît Bleuzé
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes