summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2017-08-31 15:07:38 +0300
committerAlexander Volkov <a.volkov@rusbitech.ru>2017-09-04 09:51:52 +0000
commitfefdb8466265d632675c50c53a027a86ca1af4a2 (patch)
treeeca0b0b8abdcdc4423d0a8a63ad7c3087d728303
parent50eb44cc9bd47fd91e01d36e0cb0d124cfc6e736 (diff)
moc: Use 'using' instead of 'typedef' in generated code
'using' is recommended by C++ Core Guidelines for improving readability: https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Rt-using In the case of generated code it can be useful to leave moc files unchanged when modernizing code with clang-tidy's 'modernize-use-using'. Change-Id: Iabb4de2aa8d2f9396d8c8d4ee21f80fffff1dadc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
-rw-r--r--src/tools/moc/generator.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp
index 0b45776b88..7f6650830e 100644
--- a/src/tools/moc/generator.cpp
+++ b/src/tools/moc/generator.cpp
@@ -1271,7 +1271,7 @@ void Generator::generateStaticMetacall()
continue;
anythingUsed = true;
fprintf(out, " {\n");
- fprintf(out, " typedef %s (%s::*_t)(",f.type.rawName.constData() , cdef->classname.constData());
+ fprintf(out, " using _t = %s (%s::*)(",f.type.rawName.constData() , cdef->classname.constData());
int argsCount = f.arguments.count();
for (int j = 0; j < argsCount; ++j) {