From 74fcce641a1842749fb95730650b391c32df94a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 5 Dec 2013 00:43:04 +0100 Subject: [PATCH] MSVC 2013 compatibility: more {}-related workarounds. These don't lead to internal compiler errors, but still generate cryptic error messages. --- src/Math/Test/MatrixTest.cpp | 6 ++++-- src/Math/Test/RangeTest.cpp | 3 ++- src/Math/Test/RectangularMatrixTest.cpp | 6 ++++-- src/Math/Test/VectorTest.cpp | 3 ++- src/MeshTools/Test/TipsifyTest.cpp | 7 ++++--- src/Text/Test/AbstractFontConverterTest.cpp | 3 ++- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/Math/Test/MatrixTest.cpp b/src/Math/Test/MatrixTest.cpp index 2f4c635a0..2551ff159 100644 --- a/src/Math/Test/MatrixTest.cpp +++ b/src/Math/Test/MatrixTest.cpp @@ -301,12 +301,14 @@ void MatrixTest::invertedOrthogonal() { template class BasicVec2: public Math::Vector<2, T> { public: - template BasicVec2(U&&... args): Math::Vector<2, T>{std::forward(args)...} {} + /* MSVC 2013 can't cope with {} here */ + template BasicVec2(U&&... args): Math::Vector<2, T>(std::forward(args)...) {} }; template class BasicMat2: public Math::Matrix<2, T> { public: - template BasicMat2(U&&... args): Math::Matrix<2, T>{std::forward(args)...} {} + /* MSVC 2013 can't cope with {} here */ + template BasicMat2(U&&... args): Math::Matrix<2, T>(std::forward(args)...) {} MAGNUM_MATRIX_SUBCLASS_IMPLEMENTATION(2, BasicMat2, BasicVec2) }; diff --git a/src/Math/Test/RangeTest.cpp b/src/Math/Test/RangeTest.cpp index ae4139aaf..7996c07aa 100644 --- a/src/Math/Test/RangeTest.cpp +++ b/src/Math/Test/RangeTest.cpp @@ -319,7 +319,8 @@ void RangeTest::scaled() { template class BasicRect: public Math::Range<2, T> { public: - template BasicRect(U&&... args): Math::Range<2, T>{std::forward(args)...} {} + /* MSVC 2013 can't cope with {} here */ + template BasicRect(U&&... args): Math::Range<2, T>(std::forward(args)...) {} MAGNUM_RANGE_SUBCLASS_IMPLEMENTATION(2, BasicRect, Vector2) }; diff --git a/src/Math/Test/RectangularMatrixTest.cpp b/src/Math/Test/RectangularMatrixTest.cpp index 39e39fc24..882308155 100644 --- a/src/Math/Test/RectangularMatrixTest.cpp +++ b/src/Math/Test/RectangularMatrixTest.cpp @@ -422,7 +422,8 @@ void RectangularMatrixTest::vector() { template class BasicMat: public Math::RectangularMatrix { public: - template BasicMat(U&&... args): Math::RectangularMatrix{std::forward(args)...} {} + /* MSVC 2013 can't cope with {} here */ + template BasicMat(U&&... args): Math::RectangularMatrix(std::forward(args)...) {} MAGNUM_RECTANGULARMATRIX_SUBCLASS_IMPLEMENTATION(size, size, BasicMat) }; @@ -431,7 +432,8 @@ MAGNUM_MATRIX_OPERATOR_IMPLEMENTATION(BasicMat) template class BasicMat2x2: public BasicMat<2, T> { public: - template BasicMat2x2(U&&... args): BasicMat<2, T>{std::forward(args)...} {} + /* MSVC 2013 can't cope with {} here */ + template BasicMat2x2(U&&... args): BasicMat<2, T>(std::forward(args)...) {} MAGNUM_RECTANGULARMATRIX_SUBCLASS_IMPLEMENTATION(2, 2, BasicMat2x2) }; diff --git a/src/Math/Test/VectorTest.cpp b/src/Math/Test/VectorTest.cpp index 27b247ba9..eb7561e74 100644 --- a/src/Math/Test/VectorTest.cpp +++ b/src/Math/Test/VectorTest.cpp @@ -455,7 +455,8 @@ void VectorTest::angle() { template class BasicVec2: public Math::Vector<2, T> { public: - template BasicVec2(U&&... args): Math::Vector<2, T>{std::forward(args)...} {} + /* MSVC 2013 can't cope with {} here */ + template BasicVec2(U&&... args): Math::Vector<2, T>(std::forward(args)...) {} MAGNUM_VECTOR_SUBCLASS_IMPLEMENTATION(2, BasicVec2) }; diff --git a/src/MeshTools/Test/TipsifyTest.cpp b/src/MeshTools/Test/TipsifyTest.cpp index 61da9fd17..650b7b536 100644 --- a/src/MeshTools/Test/TipsifyTest.cpp +++ b/src/MeshTools/Test/TipsifyTest.cpp @@ -56,7 +56,8 @@ class TipsifyTest: public TestSuite::Tester { */ -TipsifyTest::TipsifyTest(): indices{ +/* MSVC 2013 can't cope with only {} here */ +TipsifyTest::TipsifyTest(): indices({ 4, 1, 0, 10, 9, 13, 6, 3, 2, @@ -79,8 +80,8 @@ TipsifyTest::TipsifyTest(): indices{ 14, 11, 10, 16, 17, 18 -}, vertexCount(19) { - addTests({&TipsifyTest::buildAdjacency, +}), vertexCount(19) { + addTests({&TipsifyTest::buildAdjacency, &TipsifyTest::tipsify}); } diff --git a/src/Text/Test/AbstractFontConverterTest.cpp b/src/Text/Test/AbstractFontConverterTest.cpp index 22b04cd71..e42d483bf 100644 --- a/src/Text/Test/AbstractFontConverterTest.cpp +++ b/src/Text/Test/AbstractFontConverterTest.cpp @@ -171,7 +171,8 @@ void AbstractFontConverterTest::exportFontToFile() { /* doExportToFile() should call doExportToData() */ DataExporter exporter; - bool exported = exporter.exportFontToFile(*static_cast(nullptr), *static_cast(nullptr), Utility::Directory::join(TEXT_TEST_OUTPUT_DIR, "font.out"), {}); + /* MSVC 2013 can't handle {} here */ + bool exported = exporter.exportFontToFile(*static_cast(nullptr), *static_cast(nullptr), Utility::Directory::join(TEXT_TEST_OUTPUT_DIR, "font.out"), std::string()); CORRADE_VERIFY(exported); CORRADE_COMPARE_AS(Utility::Directory::join(TEXT_TEST_OUTPUT_DIR, "font.out"), "\xf0", TestSuite::Compare::FileToString);