summaryrefslogtreecommitdiffstats
path: root/examples/sql/sqlbrowser/browser.cpp
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2023-12-19 14:30:12 +0100
committerIvan Solovev <ivan.solovev@qt.io>2024-01-18 20:26:23 +0100
commitecafbc4d5d9a4c12f44de856dec544404c633a6e (patch)
treee6f8aec74f1081c7f8aa10725c0227719d3c0307 /examples/sql/sqlbrowser/browser.cpp
parentaae6cf8d15837c9a29503d5fdeceb2a4b5befc55 (diff)
TestLib: consistently wrap comparison helper macros into do {} while
The CHECK_SINGLE_OPERATOR macro is used inside FOR_EACH_CREF macro, which, like all other FOR_EACH_* macros in Qt (see qdebug.h or qmetatype.h), expects its parameter to have a scope or a semicolon. All other CHECK_* macros are *not* used inside FOR_EACH_CREF, so they can follow a more traditional approach with the `do { } while (false)` scope without a trailing semicolon. This allows to use them in the code like: if (condition) MACRO(args); else OTHER_MACRO(args); In the example above, if MACRO ended with the semicolon, adding one more semicolon would have discarded the else part of the conditon, leading to compilation error. Amends bfb237d19a5319bfa020ad0cefaff72e8d94a9be. Task-number: QTBUG-119433 Pick-to: 6.7 Change-Id: I9a7f17416ba7c37a50f022f685b54e2643e4a9e2 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Diffstat (limited to 'examples/sql/sqlbrowser/browser.cpp')
0 files changed, 0 insertions, 0 deletions