Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC 2015 port #96

Closed
3 of 4 tasks
mosra opened this issue May 9, 2015 · 9 comments
Closed
3 of 4 tasks

MSVC 2015 port #96

mosra opened this issue May 9, 2015 · 9 comments
Assignees
Milestone

Comments

@mosra
Copy link
Owner

mosra commented May 9, 2015

Support for MSVC 2013 is currently only in compatibility branch. I want to support MSVC 2015 in master to make users' lives easier (more frequent updates, less ugly workarounds...).

Stuff that was worked around in compatibility branch with ugly hacks and is known to be fixed/implemented in MSVC 2015:

  • char32_t etc. are no longer typedefs to unsigned int etc.
  • no need to use std::array to work around array initialization bug
  • unrestricted unions
  • user-defined literals
  • non-static data member initializers
  • noexcept, constexpr
  • __func__ (used in Corrade::TestSuite)
  • std::chrono::high_resolution_clock is now really high-resolution

Bugs/annoyances which might still be present:

  • the need to explicitly specify type when calling addTests() in Corrade::TestSuite
  • more explicit typing needed for list-initialization in comparison with GCC/Clang
  • it is not possible to have multiple definitions of template alias (unlike typedefs)

There's still one thing left that makes the port currently impossible:

  • It is not possible to initialize arrays in constexpr constructors (see Known Issues in this blog post). I'm using this rather heavily in all Vector and Matrix classes and thus the port would be far from clean. The blog post says that these bugs should be fixed in the final release or first update, so let's wait until that.
@mosra mosra added the msvc label May 9, 2015
@mosra mosra self-assigned this May 9, 2015
@mosra
Copy link
Owner Author

mosra commented Jun 3, 2015

The constexpr issue is fixed now, so nothing should stop me from doing the port when the final version is released.

@mosra
Copy link
Owner Author

mosra commented Jun 29, 2015

To be released on 2015-07-20.

@mosra mosra mentioned this issue Jul 23, 2015
26 tasks
@mosra
Copy link
Owner Author

mosra commented Jul 27, 2015

Current state (master on 20e5d95): stuck on constexpr bugs and meaningless errors which were completely okay in 2013. I made some minor changes to the buildsystem and worked around some silly {}-initialization-related bugs, will commit that to have things in clean state for further experiments.

  • Corrade::Interconnect library is completely unusable (the tests can't even compile), will investigate further. Probably my fault, because the library had some issues even on 2013. Without tests the rest compiles with some minor changes.

  • Math::RectangularMatrix compilation stops on the following:

    Math/RectangularMatrix.h(111): error C2476: 'constexpr' constructor does not initialize all members

    Removing constexpr might work, but then what's the point of that?! Minimal repro case which compiles fine on GCC/Clang but fails with crazy errors on MSVC 2015 (check the online compiler). Isn't this related to the array initialization error they promised to fix in the final version? YES IT IS.

    struct A {};
    
    struct B {
        constexpr B(): _a() {}
    
        A _a[4];
    };
  • Math::Vector compilation stops on the following:

    Math/Vector.h(177): error C2476: 'constexpr' constructor does not initialize all members

    Similar to the above, can be worked around by removing constexpr keyword. Again, what's the point of having MSVC 2015 support if I can't use constexpr at all? Minimal repro case:

    struct Foo {};
    
    struct A {
        constexpr A(Foo): _i() {}
    
        constexpr A(): A(Foo()) {}
    
        int _i;
    };
  • SceneGraph::AbstractFeature fails with the following:

    SceneGraph/AbstractFeature.h(76): error C2653: 'CachedTransformations': is not a class or namespace name

    Don't know what's causing this, I'm suspecting the parser went haywire for some unknown reason (yet another windows.h collision? misplaced whitespace? bad moon phase?). Also not present on MSVC 2013. Will investigate further in this case, because this is pathetic.

  • More funny stuff:

    Implementation/FramebufferState.h(36): error C4579: 'Magnum::Implementation::FramebufferState::DisengagedViewport': in-class initialization for type 'const Magnum::Range2Di' is not yet implemented; static member will remain uninitialized at runtime but use in constant-expressions is supported

    AbstractTexture.cpp(222): error C2143: syntax error: missing ';' before '}'

    ... (rage quit)

Any ideas what to do next? Wait for the next bugfix update? I don't want to replace every other constexpr with some crazy CONSTEXPR_ONLY_IF_WE_ARE_ON_SANE_COMPILER macro. That stuff doesn't belong in master.

@mosra
Copy link
Owner Author

mosra commented Aug 2, 2015

Initial work-in-progress MSVC 2015 support is now in master (no, it's not usable yet).

AppVeyor now has MSVC 2015 so I set up the builds for master branch too. Click the badges below to see the funny errors in action:

  • Corrade -- Build status
  • Magnum -- Build status
  • Magnum Plugins -- Build status
  • Magnum Integration -- Build status
  • Magnum Examples -- Build status

@mosra
Copy link
Owner Author

mosra commented Aug 8, 2015

@LB--
Copy link
Contributor

LB-- commented Aug 24, 2015

Is the CI up to date? I was able to build and install Corrade with Visual Studio 2015 without issue.

@mosra
Copy link
Owner Author

mosra commented Aug 25, 2015

Yes, it is. Corrade works if you don't enable tests and don't use Interconnect library.

The CI builds Corrade with tests enabled, which test also the Interconnect library and thus the build fails. Apparently MSVC 2015 has some backward incompatibilites so that everything that passed silently or with warning in 2013 now ends with an error.

@mosra
Copy link
Owner Author

mosra commented Aug 25, 2015

Got Corrade building now even with tests. It forgot what it knew in 2013 and template deduction for variable templates is broken now.

With Magnum::SceneGraph, MSVC 2015 lost it completely when encountering template aliases. Having template<class T> using Something = SomethingOther<T> somewhere in the code causes it to forget random type and variable definitions at random places (even in its own internal headers!!) with no error/warning message at all. Ugh. This can't be real.

Without Magnum::SceneGraph it somewhat compiles now (with a lot of nasty workarounds). Didn't have the courage to run the tests.

Will commit the less ugly changes to get it in somewhat usable state.

@mosra mosra mentioned this issue Aug 28, 2015
34 tasks
@mosra
Copy link
Owner Author

mosra commented Sep 7, 2015

Done as part of being mad while fixing #109 (commit log).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants