From 21e52edbfc2233e2a62de346a466c6ecd82c219c Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Date: Mon, 16 Jun 2014 14:31:30 +0200
Subject: [PATCH] pass a pointer instead of a reference to initFrom()

msvc thinks that it's impossible to create a null reference (because
some language lawyer said so) and thus complains about our assert that
checks the reference's validity. work around by not dereferencing the
pointers we already have.

Change-Id: Ife2288d4187860105de12fdebc0e671e0159ace3
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
(cherry picked from qtbase/11161bbfadd0056466fc414ed659d08a4a0fe492)
---
 src/shared/proparser/qmakeevaluator.cpp | 20 ++++++++++----------
 src/shared/proparser/qmakeevaluator.h   |  2 +-
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp
index 262985f174..09b4e72f12 100644
--- a/src/shared/proparser/qmakeevaluator.cpp
+++ b/src/shared/proparser/qmakeevaluator.cpp
@@ -196,17 +196,17 @@ QMakeEvaluator::~QMakeEvaluator()
 {
 }
 
-void QMakeEvaluator::initFrom(const QMakeEvaluator &other)
+void QMakeEvaluator::initFrom(const QMakeEvaluator *other)
 {
-    Q_ASSERT_X(&other, "QMakeEvaluator::visitProFile", "Project not prepared");
-    m_functionDefs = other.m_functionDefs;
-    m_valuemapStack = other.m_valuemapStack;
+    Q_ASSERT_X(other, "QMakeEvaluator::visitProFile", "Project not prepared");
+    m_functionDefs = other->m_functionDefs;
+    m_valuemapStack = other->m_valuemapStack;
     m_valuemapInited = true;
-    m_qmakespec = other.m_qmakespec;
-    m_qmakespecName = other.m_qmakespecName;
-    m_mkspecPaths = other.m_mkspecPaths;
-    m_featureRoots = other.m_featureRoots;
-    m_dirSep = other.m_dirSep;
+    m_qmakespec = other->m_qmakespec;
+    m_qmakespecName = other->m_qmakespecName;
+    m_mkspecPaths = other->m_mkspecPaths;
+    m_featureRoots = other->m_featureRoots;
+    m_dirSep = other->m_dirSep;
 }
 
 //////// Evaluator tools /////////
@@ -1354,7 +1354,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
             return ReturnFalse;
 #endif
 
-        initFrom(*baseEnv->evaluator);
+        initFrom(baseEnv->evaluator);
     } else {
         if (!m_valuemapInited)
             loadDefaults();
diff --git a/src/shared/proparser/qmakeevaluator.h b/src/shared/proparser/qmakeevaluator.h
index 7205e3b904..c8b42dd470 100644
--- a/src/shared/proparser/qmakeevaluator.h
+++ b/src/shared/proparser/qmakeevaluator.h
@@ -155,7 +155,7 @@ public:
     bool prepareProject(const QString &inDir);
     bool loadSpecInternal();
     bool loadSpec();
-    void initFrom(const QMakeEvaluator &other);
+    void initFrom(const QMakeEvaluator *other);
     void setupProject();
     void evaluateCommand(const QString &cmds, const QString &where);
     void applyExtraConfigs();
-- 
GitLab