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

VS 2017 Update 7 compiler ICEs on verdigris code #36

Closed
mwu-tow opened this issue May 7, 2018 · 3 comments
Closed

VS 2017 Update 7 compiler ICEs on verdigris code #36

mwu-tow opened this issue May 7, 2018 · 3 comments

Comments

@mwu-tow
Copy link

mwu-tow commented May 7, 2018

I can successfully use verdigris with Visual Studio 2017 update 6. However, installing update 7 breaks it. The compiler throws an internal error: https://developercommunity.visualstudio.com/content/problem/221080/ice-in-constexpr-code-157-regression.html

It seems to be a regression in the compiler, I don't think that any action on the verdigris side is needed. I'm reporting this here just to let you know and warn other VS users.

As a workaround, it is possible to manually enable older compiler version for a given project as described in https://blogs.msdn.microsoft.com/vcblog/2017/11/15/side-by-side-minor-version-msvc-toolsets-in-visual-studio-2017/
The last toolset version that works for me is 14.13 (VS 2017.6).

@ogoffart
Copy link
Member

I made a smaller testcase that reproduce the MSVC crash:

template<typename T>
struct MetaPropertyInfo {
    T t;

    constexpr auto setMember() const
    { return MetaPropertyInfo<T> {t}; }
};

struct XX  {
public:
    static constexpr auto w_PropertyState() {
        MetaPropertyInfo<std::nullptr_t> meta{ };
        return meta.setMember();
    }
};

int main() {
    constexpr auto doo = XX::w_PropertyState();
}

Interrestingly, if i replace std::nullptr_t with something else, it works. So i'll do that

ogoffart added a commit that referenced this issue May 24, 2018
Testcase:

 template<typename T>
 struct MetaPropertyInfo {
   T t;

   constexpr auto setMember() const
   { return MetaPropertyInfo<T> {t}; }
 };

  struct XX  {
    static constexpr auto w_PropertyState() {
      MetaPropertyInfo<std::nullptr_t> meta{ };
      return meta.setMember();
    }
  };
  int main() {
   constexpr auto doo =	XX::w_PropertyState();
  }

#36
@jcelerier
Copy link
Collaborator

thanks !

@mwu-tow
Copy link
Author

mwu-tow commented May 24, 2018

Thank you!
I have also updated the VS bugreport with the reduced repro.

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

No branches or pull requests

3 participants