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

            Bug ID: 381965
           Summary: Wrapping a header include in extern "C" breaks
                    highlighting
           Product: kdevelop
           Version: git master
          Platform: Compiled Sources
                OS: Linux
            Status: UNCONFIRMED
          Severity: minor
          Priority: NOR
         Component: Language Support: CPP (Clang-based)
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

If I have foo.h with:

void foo();
struct Bar {
    int field;
};

And main.cpp with:

extern "C" {
#include "foo.h"
}
int main() {
    foo();
    Bar* b;
    int x = b->field;
}

The call to foo appears in black and doesn't show a tooltip. The same happens
with 'Bar' and 'field'. However, nothing is underlined as an error either.

As a workaround, I can remove (or comment out) the extern "C" wrapper, save the
file, and reload. Then the highlighting starts working. Now I can add extern
"C" again and it keeps working. If I reload the file I have to do the
workaround again.

Note that this doesn't happen if it's all in the same file, ie. having extern
"C" { void foo(); } in either the .cpp or in the header.

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

Reply via email to