Skip to content

Commit

Permalink
Disable Clang warning for 'using namespace' in qtextstream.h
Browse files Browse the repository at this point in the history
This header file intentionally puts a 'using namespace' into the global
namespace, the artful cleverness of which Clang doesn't properly appreciate.
Teach Clang a lesson by disabling the warning.

Change-Id: I9754ac5fc9d4c53654854082e1145d8b5fef186d
Reviewed-by: Allan Sandfeld Jensen <[email protected]>
  • Loading branch information
valdmann committed Oct 25, 2019
1 parent 43f64b4 commit bafb822
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/corelib/serialization/qtextstream.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,12 @@ namespace Qt {
using namespace QTextStreamFunctions;
}

QT_WARNING_PUSH
QT_WARNING_DISABLE_CLANG("-Wheader-hygiene")
// We use 'using namespace' as that doesn't cause
// conflicting definitions compiler errors.
using namespace QTextStreamFunctions;
QT_WARNING_POP
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0) && !defined(Q_QDOC)

inline QTextStreamManipulator qSetFieldWidth(int width)
Expand Down

0 comments on commit bafb822

Please sign in to comment.