I'm using KDevelop git master (2012-06-25). Consider the following code: #include <chrono> constexpr std::chrono::nanoseconds operator"" _nsec(unsigned long long val) { return std::chrono::nanoseconds(val); } The "constexpr..." line is highlighted in red, with the following errors in the Problems tool view: "Unexpected token 'string literal'", "Unexpected token 'operator'". See http://en.wikipedia.org/wiki/C%2B%2B11#User-defined_literals for more info. Thanks Reproducible: Always Steps to Reproduce: 1. Try the code sample Actual Results: KDevelop shows errors Expected Results: There shouldn't be any errors. Even better, KDevelop should treat the user-defined string literals as values having the types returned by respective operators defined in current namespace. openSUSE 12.1 x86-64, gcc 4.7.1.
Patch in progress: https://git.reviewboard.kde.org/r/103485/
Works in principal in KDevelop 5, using the Clang backend. But there's a bug. Example: ``` #include <chrono> constexpr std::chrono::nanoseconds operator"" _nsec(unsigned long long val) { return std::chrono::nanoseconds(val); } auto i = 123_nsec ``` Highlight the second '_nsec'. Issue: Definition is the range 'operator', not the first '_nsec'
Upstream issue. Patch at http://reviews.llvm.org/D18462