dmlc / dmlc/xgboost

[MSVC][permissive-] xgboost failed to build with error C3779 under /permissive- on MSVC

Open
#7,795 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
28.8k
Forks
8.9k
Avg merge
1d 12h
Merged PRs (30d)
54

Description

Hi all,
The MSVC team recently added xgboost as part of RWC testing. But we found error C3779 when building xgboost with '/permissive-'. Could you please take a quick look at the issue? Thanks in advance.

**Repro steps:**
1. git clone https://github.com/dmlc/xgboost.git F:\gitP\dmlc\xgboost
2. cd F:\gitP\dmlc\xgboost & mkdir build_amd64
3. set _CL_= /permissive-
4. cd F:\gitP\dmlc\xgboost\build_amd64
5. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DGOOGLE_TEST=ON -DUSE_DMLC_GTEST=ON ..
6. msbuild /m /p:Platform=x64 /p:Configuration=Release xgboost.sln /t:Rebuild

**Expected Behavior**
xgboost could build successfully with '/permissive-'.

**Actual Behavior**
[build.log](https://github.com/dmlc/xgboost/files/8463018/build.log)

test_regen.cc
F:\gitP\dmlc\xgboost\tests\cpp\tree\test_regen.cc(69,30): error C3779: 'xgboost::`anonymous-namespace'::RegenTest::Iter': a function that returns 'auto' cannot be used before it is defined
F:\gitP\dmlc\xgboost\tests\cpp\tree\test_regen.cc(60): note: see declaration of 'xgboost::`anonymous-namespace'::RegenTest::Iter'
F:\gitP\dmlc\xgboost\tests\cpp\tree\test_regen.cc(63,10): note: This diagnostic occurred in the compiler generated function 'size_t xgboost::`anonymous-namespace'::RegenTest::TestTreeMethod(std::string,std::string,bool) const'

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.