| 1 |
/* |
| 2 |
SPDX-FileCopyrightText: 2015 Klarälvdalens Datakonsult AB a KDAB Group company [email protected] |
| 3 |
SPDX-FileContributor: Sérgio Martins <[email protected]> |
| 4 |
|
| 5 |
SPDX-FileCopyrightText: 2015 Sergio Martins <[email protected]> |
| 6 |
|
| 7 |
SPDX-License-Identifier: LGPL-2.0-or-later |
| 8 |
*/ |
| 9 |
|
| 10 |
#ifndef RANGELOOP_DETACHMENTS_H |
| 11 |
#define RANGELOOP_DETACHMENTS_H |
| 12 |
|
| 13 |
#include "checkbase.h" |
| 14 |
|
| 15 |
namespace clang |
| 16 |
{ |
| 17 |
class CXXForRangeStmt; |
| 18 |
} |
| 19 |
|
| 20 |
/** |
| 21 |
* Finds places where you're using C++11 for range loops with Qt containers. (potential detach) |
| 22 |
*/ |
| 23 |
class RangeLoopDetach : public CheckBase |
| 24 |
{ |
| 25 |
public: |
| 26 |
using CheckBase::CheckBase; |
| 27 |
void VisitStmt(clang::Stmt *stmt) override; |
| 28 |
|
| 29 |
private: |
| 30 |
bool islvalue(clang::Expr *exp, clang::SourceLocation &endLoc); |
| 31 |
void processForRangeLoop(clang::CXXForRangeStmt *rangeLoop); |
| 32 |
}; |
| 33 |
|
| 34 |
#endif |