summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2009-07-24 20:46:37 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2009-07-27 16:16:37 +0200
commitb2261de3937e7574b4d17b055f685878c33ec319 (patch)
tree6acb4512ef1f8f5cf404d10b405d8c8da94e8529
parentf120b5e4b63cbc30874fa21947b75d352f18d7df (diff)
downloadqt4-tools-b2261de3937e7574b4d17b055f685878c33ec319.tar.gz
Work around a Sun CC 5.9 compiler bug: the threadEngine variable isn't found.
QtConcurrent had the following code: template <typename T> class ThreadEngineStarterBase { ... protected: ThreadEngine<T> *threadEngine; }; template <typename T> class ThreadEngineStarter : public ThreadEngineStarterBase<T> { public: ThreadEngineStarter(ThreadEngine<T> *threadEngine) :ThreadEngineStarterBase<T>(threadEngine) {} [...] }; The Sun CC compiler simply didn't parse the parameter declaration in the constructor. Instead of complaining, it silently ignored the problem. Which meant that the constructor simply used the uninitialised member variable from the base class to call the parent constructor, which ended up initialised with itself. You'd think that it's just because the parameter has the same name as a member variable. But it appears to be a compiler bug altogether. If you change the name, then you start getting compile errors. This change is a workaround that worked. Reviewed-By: Bradley T. Hughes
-rw-r--r--src/corelib/concurrent/qtconcurrentthreadengine.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/corelib/concurrent/qtconcurrentthreadengine.h b/src/corelib/concurrent/qtconcurrentthreadengine.h
index 1f359fc0e3..2f610defd5 100644
--- a/src/corelib/concurrent/qtconcurrentthreadengine.h
+++ b/src/corelib/concurrent/qtconcurrentthreadengine.h
@@ -238,9 +238,11 @@ protected:
template <typename T>
class ThreadEngineStarter : public ThreadEngineStarterBase<T>
{
+ typedef ThreadEngineStarterBase<T> Base;
+ typedef ThreadEngine<T> TypedThreadEngine;
public:
- ThreadEngineStarter(ThreadEngine<T> *threadEngine)
- :ThreadEngineStarterBase<T>(threadEngine) {}
+ ThreadEngineStarter(TypedThreadEngine *eng)
+ : Base(eng) { }
T startBlocking()
{