summaryrefslogtreecommitdiffstats
path: root/src/tools/moc/moc.cpp
diff options
context:
space:
mode:
authorJędrzej Nowacki <jedrzej.nowacki@qt.io>2018-09-24 11:28:46 +0200
committerJędrzej Nowacki <jedrzej.nowacki@qt.io>2018-10-01 09:45:31 +0000
commit5b99f3a34fef527beb8767eb12657f81ee65b969 (patch)
tree3fd514bd1a10ee11a0d16ef9b541e6a2b14edb4d /src/tools/moc/moc.cpp
parentb9ce354fb09bae11e04e1cb6b37e037a7c93b749 (diff)
Use std::addressof for taking an address instead of operator& in moc
Moc shouldn't artificially introduce calls to possibly overloaded operator&. It can cause odd side effects in a user code. Change-Id: Iaa1b491fe6a1a5ebd4dfa1172359dc792cc7604f Fixes: QTBUG-68191 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r--src/tools/moc/moc.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 61a5542c83..76816960ff 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -992,7 +992,7 @@ void Moc::generate(FILE *out)
fprintf(out, "** WARNING! All changes made in this file will be lost!\n"
"*****************************************************************************/\n\n");
-
+ fprintf(out, "#include <memory>\n"); // For std::addressof
if (!noInclude) {
if (includePath.size() && !includePath.endsWith('/'))
includePath += '/';