| Summary: | KDevelop errors out on user-defined string literal operators | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | Alexander <ashaduri> |
| Component: | Language Support: CPP (Clang-based) | Assignee: | kdevelop-bugs-null |
| Status: | RESOLVED UPSTREAM | ||
| Severity: | normal | CC: | kfunk |
| Priority: | NOR | Keywords: | junior-jobs |
| Version First Reported In: | git master | ||
| Target Milestone: | 5.0.0 | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
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 |
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.