forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/2.6'
Conflicts: qtcreator.pri qtcreator.qbp src/libs/ssh/sshconnection.cpp Change-Id: I2946cbec1b5159eef9e47949860b28fba1e51529
This commit is contained in:
15
src/libs/3rdparty/cplusplus/Name.cpp
vendored
15
src/libs/3rdparty/cplusplus/Name.cpp
vendored
@@ -18,10 +18,13 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "Literals.h"
|
||||
#include "Name.h"
|
||||
#include "Names.h"
|
||||
#include "NameVisitor.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
Name::Name()
|
||||
@@ -65,4 +68,16 @@ void Name::accept(const Name *name, NameVisitor *visitor)
|
||||
name->accept(visitor);
|
||||
}
|
||||
|
||||
bool Name::Compare::operator()(const Name *name, const Name *other) const
|
||||
{
|
||||
if (name == 0)
|
||||
return other != 0;
|
||||
if (other == 0)
|
||||
return false;
|
||||
if (name == other)
|
||||
return false;
|
||||
|
||||
const Identifier *id = name->identifier();
|
||||
const Identifier *otherId = other->identifier();
|
||||
return std::strcmp(id->chars(), otherId->chars()) < 0;
|
||||
}
|
||||
|
||||
6
src/libs/3rdparty/cplusplus/Name.h
vendored
6
src/libs/3rdparty/cplusplus/Name.h
vendored
@@ -23,6 +23,7 @@
|
||||
|
||||
#include "CPlusPlusForwardDeclarations.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
@@ -55,6 +56,11 @@ public:
|
||||
void accept(NameVisitor *visitor) const;
|
||||
static void accept(const Name *name, NameVisitor *visitor);
|
||||
|
||||
public:
|
||||
struct Compare: std::binary_function<const Name *, const Name *, bool> {
|
||||
bool operator()(const Name *name, const Name *other) const;
|
||||
};
|
||||
|
||||
protected:
|
||||
virtual void accept0(NameVisitor *visitor) const = 0;
|
||||
};
|
||||
|
||||
4
src/libs/3rdparty/cplusplus/Templates.cpp
vendored
4
src/libs/3rdparty/cplusplus/Templates.cpp
vendored
@@ -514,10 +514,12 @@ Symbol *Clone::instantiate(Template *templ, const FullySpecifiedType *const args
|
||||
//
|
||||
// substitutions
|
||||
//
|
||||
|
||||
|
||||
FullySpecifiedType Subst::apply(const Name *name) const
|
||||
{
|
||||
if (name) {
|
||||
std::map<const Name *, FullySpecifiedType>::const_iterator it = _map.find(name);
|
||||
std::map<const Name *, FullySpecifiedType, Name::Compare>::const_iterator it = _map.find(name);
|
||||
if (it != _map.end())
|
||||
return it->second;
|
||||
else if (_previous)
|
||||
|
||||
3
src/libs/3rdparty/cplusplus/Templates.h
vendored
3
src/libs/3rdparty/cplusplus/Templates.h
vendored
@@ -24,6 +24,7 @@
|
||||
#include "CPlusPlusForwardDeclarations.h"
|
||||
#include "TypeVisitor.h"
|
||||
#include "FullySpecifiedType.h"
|
||||
#include "Name.h"
|
||||
#include "NameVisitor.h"
|
||||
#include "SymbolVisitor.h"
|
||||
#include <map>
|
||||
@@ -56,7 +57,7 @@ public:
|
||||
private:
|
||||
Control *_control;
|
||||
Subst *_previous;
|
||||
std::map<const Name *, FullySpecifiedType> _map;
|
||||
std::map<const Name *, FullySpecifiedType, Name::Compare> _map;
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT CloneType: protected TypeVisitor
|
||||
|
||||
Reference in New Issue
Block a user