Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
Qt Creator 4.7.0
-
None
-
c12b012bb7465299490cf93c2ae90499a5c417d5 (clang/clang/release_80-based) e37a2ef5aa162dba9e221ac2cfa4b7e036cb0950 (clang/llvm-project/release_80-based)
Description
Edit: this happens when two include files include each other and include guards are used. It does not happen with #pragma once. Please see comment further down for minimal example
In one very specific case, Qt Creator incorrectly highlights and shows an error when using nested conditional directives.
Error shown:
#ifndef COMMON_H // <-- unterminated conditional directive #define COMMON_H #include <cstdint> #ifdef ISSERVER #include <QSqlQuery> #include <log.h> #endif // ... namespace Common { // ... #ifdef ISSERVER // ... #endif // ISSERVER } #endif // COMMON_H
No error:
#ifndef COMMON_H #define COMMON_H #include <cstdint> #ifdef ISSERVER #include <QSqlQuery> //#include <log.h> // <-- commented #endif // ... namespace Common { // ... #ifdef ISSERVER // ... #endif // ISSERVER } #endif // COMMON_H
#pragma once // <-- added #ifndef COMMON_H #define COMMON_H #include <cstdint> #ifdef ISSERVER #include <QSqlQuery> #include <log.h> #endif // ... namespace Common { // ... #ifdef ISSERVER // ... #endif // ISSERVER } #endif // COMMON_HÂ
Attachments
Issue Links
- duplicates
-
QTCREATORBUG-18801 Clang: Unterminated conditional directive when there's an opening brace inside unsatisfied #if
- Closed
- relates to
-
QTCREATORBUG-21437 Unterminated #pragma pack(..)
- Open
For Gerrit Dashboard: QTCREATORBUG-20883 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
254109,3 | [backported/clang-9][Preamble] Stop circular inclusion of main file when building preamble | release_80-based | clang/clang | Status: MERGED | +2 | 0 |
261343,1 | [backported/clang-9][Preamble] Stop circular inclusion of main file when building preamble | release_70-based | clang/clang | Status: ABANDONED | 0 | 0 |
264041,2 | [backported/clang-9][preamble] Stop circular inclusion of main file when building preamble | release_80-based | clang/llvm-project | Status: MERGED | +2 | 0 |