Skip to content

Commit 68919b2

Browse files
committed
Propagate const-ness from friend operators
This is not necessary (const-ness would actually apply to some shared wrapper object, not the wrapped object itself), but made it somewhat easier to compare with generated code from earlier Qt versions
1 parent 0c7812c commit 68919b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

generator/abstractmetabuilder.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ void AbstractMetaBuilder::traverseCompareOperator(FunctionModelItem item) {
262262
if (meta_function != 0 && !meta_function->isInvalid()) {
263263
// Strip away first argument, since that is the containing object
264264
AbstractMetaArgumentList arguments = meta_function->arguments();
265+
if (arguments.front()->type()->isConstant()) {
266+
// propagate constness, though it makes no real difference for the wrapper
267+
// (but I found it helps when comparing to previous results)
268+
meta_function->setConstant(true);
269+
}
265270
arguments.pop_front();
266271
meta_function->setArguments(arguments);
267272

0 commit comments

Comments
 (0)