https://bugs.kde.org/show_bug.cgi?id=460870

            Bug ID: 460870
           Summary: Code completions turns . into -> for floating point
                    number
    Classification: Applications
           Product: kdevelop
           Version: git master
          Platform: Compiled Sources
                OS: Linux
            Status: REPORTED
          Severity: minor
          Priority: NOR
         Component: Language Support: CPP (Clang-based)
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 153129
  --> https://bugs.kde.org/attachment.cgi?id=153129&action=edit
illustrating video

SUMMARY
In some rare circumstances, the code completion turns . into an ->, when typing
floating point values without leading zero. I found this inside of aggregate
initialization of a std::array, but did not check if there are other
circumstances where this also happens. See also the attached video.
A reproducible code example would be this:

#include <array>
struct S {double a, double b};

int main() {
    std::array<S, 1> a = {{
     {0.6, /* here type a dot, and it will be converted to an arrow */ }
    }};
}


If someone gives me a pointer where to start I'm willing to try fixing this
myself.


STEPS TO REPRODUCE
1. Put the code example in a cmake c++ project
2. try to type a floatingpoint number like .5 without leading 0 in the
aggregate initializer

OBSERVED RESULT
code completion turns . into ->

EXPECTED RESULT
code completion does nothing

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Fedora 36 - Kernel 5.19
(available in About System)
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to