forked from qt-creator/qt-creator
ClangBackEnd: Fix mis-detection of operator<
Inside the body of a function template, clang reports a different cursor type for operators in some cases. Make sure we don't mistake such operator< or operator> as opening or closing a template, respectively. Fixes: QTCREATORBUG-25596 Change-Id: Ifc357e199ea13e44ac501613639e667c333d48e3 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -771,3 +771,20 @@ void func(T v) {
|
||||
}
|
||||
|
||||
static std::vector<std::pair<int, int>> pv;
|
||||
|
||||
template <class T, long S>
|
||||
struct vecn
|
||||
{
|
||||
T v[S];
|
||||
};
|
||||
|
||||
template <class T, long S>
|
||||
static inline constexpr vecn<T, S> operator<(vecn<T, S> a, vecn<T, S> b)
|
||||
{
|
||||
vecn<T, S> x = vecn<T, S>{};
|
||||
for(long i = 0; i < S; ++i)
|
||||
{
|
||||
x[i] = a[i] < b[i];
|
||||
}
|
||||
return x;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user