diff options
| author | Christian Kandeler <christian.kandeler@qt.io> | 2024-09-23 14:12:59 +0200 |
|---|---|---|
| committer | Christian Kandeler <christian.kandeler@qt.io> | 2024-09-25 11:40:03 +0000 |
| commit | 80fdc9eb939f883d3edc7002cd036db08d046487 (patch) | |
| tree | b7880c96ca33365487bf7bef3d492eda72ffc2d1 /src/libs/cplusplus/pp-engine.cpp | |
| parent | f4708468669fa4dabfb4382cd189cd36b895e915 (diff) | |
CPlusPlus: Fix pragma parsing
Trailing comments were not handled properly.
Amends ccae4fc93c3bdddc37e8cf68d9f0923fb64c1e7c.
Fixes: QTCREATORBUG-31611
Change-Id: I9ec57e4b90faa6a5097f1bfdcaff20531b3dc589
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/libs/cplusplus/pp-engine.cpp')
| -rw-r--r-- | src/libs/cplusplus/pp-engine.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libs/cplusplus/pp-engine.cpp b/src/libs/cplusplus/pp-engine.cpp index 2357397c7dc..32de4afb894 100644 --- a/src/libs/cplusplus/pp-engine.cpp +++ b/src/libs/cplusplus/pp-engine.cpp @@ -1876,8 +1876,11 @@ void Preprocessor::handlePragmaDirective(PPToken *tk) lex(tk); // consume "pragma" token while (isContinuationToken(*tk)) { - if (!consumeComments(tk)) - return; + if (tk->isComment()) { + if (!consumeComments(tk)) + return; + continue; + } pragma.tokens << tk->asByteArrayRef().toByteArray(); lex(tk); } |
