Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Define THRUST_CPP_DIALECT correctly under MSVC #1028

Merged
merged 1 commit into from
Oct 28, 2019

Conversation

bjude
Copy link
Contributor

@bjude bjude commented Oct 26, 2019

MSVC doesnt define __cplusplus correctly unless a compiler flag is passed (/Zc:__cplusplus) but _MSVC_LANG is defined correctly.
To avoid users needing to pass an extra compile flag, I suggest we handle it in the cpp_dialect.h file

MSVC doesnt define __cplusplus correctly unless a compiler flag is passed (/Zc:__cplusplus) but _MSVC_LANG is defined correctly.
To avoid users needing to pass an extra compile flag, I suggest we handle it in the cpp_dialect.h file
@brycelelbach
Copy link
Collaborator

Yep, this is a clear oversight.

Running internal CI.

@griwes to code review.

Copy link
Collaborator

@brycelelbach brycelelbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_MSVC_LANG is only defined by MSVC 2015 and later, but that should be fine; if it's not defined, it'll expand to 0 and will be treated as C++03, which is what we want anyways.

@brycelelbach
Copy link
Collaborator

Passed internal CI.

@brycelelbach brycelelbach merged commit 20e1c43 into NVIDIA:master Oct 28, 2019
@brycelelbach
Copy link
Collaborator

We had to revert this - what we need to do here is a bit more complicated, as MSVC isn't fully compliant (expression SFINAE) until newer versions.

Can you open an issue to discuss this further?

@bjude
Copy link
Contributor Author

bjude commented Oct 29, 2019

Damn, i only tested using VS2019.

Issue #1030 created to track this.

@bjude bjude deleted the msvc_cpp_ver branch March 24, 2020 02:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants