In 2022¹, we gave ourselves the rule to allow #pragma once only in non-installed headers (examples, tools, snippets, ...), because the same installed header may reside in different places in the filesystem and #pragma once would treat these as separate headers, causing multiple-definition errors. Recently, the question came up: "What constitutes a public header?" Non-_p.h headers in e.g. src/plugins/ muddy the waters here a bit. Since #pragma once is forbidden in installed headers, I had the idea to use it to indicate non-installed headers. This patch enables use of #pragma once as a static assertion to that effect, should we so choose. ¹ https://lists.qt-project.org/pipermail/development/2022-October/043121.html Pick-to: 6.6 6.5 Fixes: QTBUG-122813 Change-Id: I3b5beef72e154cf5bf1ccd4b6f02df9680609e43 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> (cherry picked from commit 1c8884fc277c5916a420a3c14de68547a391f9fc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%