Fix MSVC warning C4067 (unexpected tokens following preprocessor directive - expected a newline) #3871
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since #3634 I'm getting a C4067 warning (see Windows Azure builds):
This is caused due to this bug.
Now I played a bit with godbolt and saw that #3634 even destroyed the deprecated warning for MSVC 2015 & 2017, as
__has_cpp_attribute
is only supportd since MSVC 2019. You can try it here (MSVC 19.1X => 2017, 19.2X => 2019).As @taketwo mentioned here MSVC 2015 is the base line is not MSVC 2013 and MSVC 2015 (19.0) already supports
[[deprecated]]
see here I solved it by always using[[deprecated]]
for MSVC.Even I could not reproduce the issue from @office-florian-hubner with CUDA 10.2 on my MSVC 2017 (15.9.21) machine, I added the check again with
__CUDACC__
(@office-florian-hubner If you see this: which environment you are using?)