7

I just downloaded KDevelop because it scans header files to offer better suggestions in code completion.
I was looking at all the keywords it suggests when no header files are included at all: enter image description here
Why is it recommending "incr"?
That's not a C++ keyword.


What is it, and what is it used for?
I thought it might be short for increment..?

Fred
  • 4,894
  • 1
  • 31
  • 48
Trevor Hickey
  • 36,288
  • 32
  • 162
  • 271
  • 3
    What happens when you select it? Maybe it becomes `++i`? – Zane Dec 18 '12 at 22:08
  • In Tcl incr is the same ++ operator from C. I haven't heard before about the existance of the incr operator in C. Maybe KDevelop displays operators for other languages? – Hernan Velasquez Dec 18 '12 at 22:14

2 Answers2

3

Probably it's a bug. Looking at KDevelop source, incr has been add for code completion in file languages/cpp/codecompletion/context.cpp on line 2326. It looks like a synonym to increment operation, however only valid synonyms are: and (&&), bitand (&), and_eq (&=), or (||), bitor (|), or_eq (|=), xor (^), xor_eq (^=), not (!), not_eq (!=), compl (~)

hate-engine
  • 2,300
  • 18
  • 26
1

I can't see any mention of incr as a keyword or alternative token (such as and for &&) in either C++98 or C++11 so I can only conclude that some other language uses that keyword and KDevelop didn't properly pull in the C++-only keyword set for name suggestions.

Mark B
  • 95,107
  • 10
  • 109
  • 188