Commit 984e82b5 authored by Nikolai Kosjar's avatar Nikolai Kosjar
Browse files

Clang: Fix compilation with MSVC2013



Change-Id: Iac0a025c3cb5c59d0da4c83d4fd60794a2911ea4
Reviewed-by: default avatarMarco Bubke <marco.bubke@theqtcompany.com>
parent d67a8551
......@@ -32,6 +32,11 @@
namespace ClangBackEnd {
UnsavedFile::UnsavedFile()
: cxUnsavedFile(CXUnsavedFile{nullptr, nullptr, 0UL})
{
}
UnsavedFile::UnsavedFile(const Utf8String &filePath, const Utf8String &fileContent)
{
char *cxUnsavedFilePath = new char[filePath.byteSize() + 1];
......@@ -45,13 +50,13 @@ UnsavedFile::UnsavedFile(const Utf8String &filePath, const Utf8String &fileConte
ulong(fileContent.byteSize())};
}
UnsavedFile::UnsavedFile(UnsavedFile &&other) noexcept
UnsavedFile::UnsavedFile(UnsavedFile &&other) Q_DECL_NOEXCEPT
: cxUnsavedFile(other.cxUnsavedFile)
{
other.cxUnsavedFile = { nullptr, nullptr, 0UL };
}
UnsavedFile &UnsavedFile::operator=(UnsavedFile &&other) noexcept
UnsavedFile &UnsavedFile::operator=(UnsavedFile &&other) Q_DECL_NOEXCEPT
{
using std::swap;
......
......@@ -25,6 +25,8 @@
#pragma once
#include <QtGlobal>
#include <clang-c/Index.h>
#include <iosfwd>
......@@ -40,14 +42,15 @@ class UnsavedFile
public:
friend void PrintTo(const UnsavedFile &unsavedFile, std::ostream *os);
UnsavedFile();
UnsavedFile(const Utf8String &filePath, const Utf8String &fileContent);
~UnsavedFile();
UnsavedFile(const UnsavedFile &other) = delete;
bool operator=(const UnsavedFile &other) = delete;
UnsavedFile(UnsavedFile &&other) noexcept;
UnsavedFile &operator=(UnsavedFile &&other) noexcept;
UnsavedFile(UnsavedFile &&other) Q_DECL_NOEXCEPT;
UnsavedFile &operator=(UnsavedFile &&other) Q_DECL_NOEXCEPT;
const char *filePath() const;
......@@ -57,7 +60,7 @@ public:
CXUnsavedFile *data();
public: // for tests
CXUnsavedFile cxUnsavedFile = { nullptr, nullptr, 0UL };
CXUnsavedFile cxUnsavedFile;
};
} // namespace ClangBackEnd
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment