aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDale Marchand <dale.marchand@gmail.com>2014-06-17 17:41:39 -0700
committerErik Verbruggen <erik.verbruggen@digia.com>2014-06-18 11:06:45 +0200
commitff52061e5238836ecfb00ebcf5fa053df22e5468 (patch)
tree0169322d209eea883e8a7de201704943338f6ad6
parent6fd6291ac82b9caf94afe6b9ae8b3d19a5dab317 (diff)
Fixed compilation error on RHEL 5.10.
Nesting the namespace "Internal" inside of other namespaces and using sequential "using namespace" directives *or* relying on a "using namespace" directive to resolve a method name that contained the "Internal" namespace for resolution resulted in ambiguous resolution errors when compiling with the RHEL5.10 stock compiler (GCC 4.1.2). A sample error is provided below: Compilation error encountered was: reference to 'Internal' is ambiguous /usr/lib/gcc/x86_64-redhat- candidates are: namespace Internal { } qt-creator/src/libs/cplusplus/PPToken.h:106: error: namespace CPlusPlus::Internal { } Modifying the using namespace directives to reflect the nested nature of the namespace names resolved the compilation errors. For example: using namespace CppEditor; using namespace Internal; produced errors. However, using namespace CppEditor; using namespace CppEditor::Internal; resolved the compilation errors by removing the ambiguity. Change-Id: I6d5051e20acb2c147bd7ee1c6c6e1e3b2b4ff0f9 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
-rw-r--r--src/libs/cplusplus/PPToken.cpp3
-rw-r--r--src/plugins/cppeditor/cppelementevaluator.cpp2
-rw-r--r--src/plugins/cppeditor/cppincludehierarchy.cpp2
-rw-r--r--src/plugins/cppeditor/cppsnippetprovider.cpp2
-rw-r--r--src/plugins/cppeditor/cpptypehierarchy.cpp2
5 files changed, 6 insertions, 5 deletions
diff --git a/src/libs/cplusplus/PPToken.cpp b/src/libs/cplusplus/PPToken.cpp
index 7b34c1ed35..232569616d 100644
--- a/src/libs/cplusplus/PPToken.cpp
+++ b/src/libs/cplusplus/PPToken.cpp
@@ -32,6 +32,7 @@
#include <cstring>
using namespace CPlusPlus;
+using namespace CPlusPlus::Internal;
bool ByteArrayRef::startsWith(const char *s) const
{
@@ -52,7 +53,7 @@ int ByteArrayRef::count(char ch) const
return num;
}
-void Internal::PPToken::squeezeSource()
+void PPToken::squeezeSource()
{
if (hasSource()) {
m_src = m_src.mid(offset, f.length);
diff --git a/src/plugins/cppeditor/cppelementevaluator.cpp b/src/plugins/cppeditor/cppelementevaluator.cpp
index 0da38d6958..09fbd8a875 100644
--- a/src/plugins/cppeditor/cppelementevaluator.cpp
+++ b/src/plugins/cppeditor/cppelementevaluator.cpp
@@ -42,7 +42,7 @@
#include <QQueue>
using namespace CppEditor;
-using namespace Internal;
+using namespace CppEditor::Internal;
using namespace CPlusPlus;
namespace {
diff --git a/src/plugins/cppeditor/cppincludehierarchy.cpp b/src/plugins/cppeditor/cppincludehierarchy.cpp
index e32467d238..1af8f2595a 100644
--- a/src/plugins/cppeditor/cppincludehierarchy.cpp
+++ b/src/plugins/cppeditor/cppincludehierarchy.cpp
@@ -50,7 +50,7 @@
#include <QVBoxLayout>
using namespace CppEditor;
-using namespace Internal;
+using namespace CppEditor::Internal;
using namespace Utils;
namespace CppEditor {
diff --git a/src/plugins/cppeditor/cppsnippetprovider.cpp b/src/plugins/cppeditor/cppsnippetprovider.cpp
index 4da115396f..88f2f28750 100644
--- a/src/plugins/cppeditor/cppsnippetprovider.cpp
+++ b/src/plugins/cppeditor/cppsnippetprovider.cpp
@@ -42,7 +42,7 @@
#include <QCoreApplication>
using namespace CppEditor;
-using namespace Internal;
+using namespace CppEditor::Internal;
CppSnippetProvider::CppSnippetProvider() :
TextEditor::ISnippetProvider()
diff --git a/src/plugins/cppeditor/cpptypehierarchy.cpp b/src/plugins/cppeditor/cpptypehierarchy.cpp
index 7427114106..b04808d678 100644
--- a/src/plugins/cppeditor/cpptypehierarchy.cpp
+++ b/src/plugins/cppeditor/cpptypehierarchy.cpp
@@ -44,7 +44,7 @@
#include <QLabel>
using namespace CppEditor;
-using namespace Internal;
+using namespace CppEditor::Internal;
using namespace Utils;
namespace {