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

Cannot compile 1.72.0 on Windows using Visual Studio 2019 with /std:c++latest #325

Closed
felixhao28 opened this issue Feb 6, 2020 · 7 comments

Comments

@felixhao28
Copy link

The source of boost library is acquired from https://www.boost.org/users/history/version_1_72_0.html .

As the title indicates, compilation fails on boost 1.72.0 while 1.71.0 works fine with /std:c++latest on Visual Studio 2019. And /std:c++17 works fine too.

Not sure this is a bug with Visual Studio or boost library. I opened an issue for Visual Studio team, too.

@kartikeytewari
Copy link

kartikeytewari commented Feb 6, 2020 via email

@felixhao28
Copy link
Author

It prints a lot of errors. The first ones are:

1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(44,1): error C2062: type 'bool' unexpected (compiling source file JavaPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(44,1): error C2062: type 'bool' unexpected (compiling source file LangUtilsTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2143: syntax error: missing ';' before '{' (compiling source file JavaPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(44,1): error C2062: type 'bool' unexpected (compiling source file ExecutorTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2143: syntax error: missing ';' before '{' (compiling source file LangUtilsTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2447: '{': missing function header (old-style formal list?) (compiling source file JavaPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(44,1): error C2062: type 'bool' unexpected (compiling source file PythonPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2143: syntax error: missing ';' before '{' (compiling source file ExecutorTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2447: '{': missing function header (old-style formal list?) (compiling source file LangUtilsTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(56,30): error C7568: argument list missing after assumed function template 'callable_with' (compiling source file JavaPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(58): message : see reference to class template instantiation 'boost::asio::detail::is_completion_handler_for<T,R(Args...)>' being compiled (compiling source file JavaPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2143: syntax error: missing ';' before '{' (compiling source file PythonPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2447: '{': missing function header (old-style formal list?) (compiling source file ExecutorTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(56,30): error C7568: argument list missing after assumed function template 'callable_with' (compiling source file LangUtilsTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(58): message : see reference to class template instantiation 'boost::asio::detail::is_completion_handler_for<T,R(Args...)>' being compiled (compiling source file LangUtilsTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(44,1): error C2062: type 'bool' unexpected (compiling source file PredictionBase.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(56,2): error C2059: syntax error: '>' (compiling source file JavaPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2447: '{': missing function header (old-style formal list?) (compiling source file PythonPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(56,30): error C7568: argument list missing after assumed function template 'callable_with' (compiling source file ExecutorTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(58): message : see reference to class template instantiation 'boost::asio::detail::is_completion_handler_for<T,R(Args...)>' being compiled (compiling source file ExecutorTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(44,1): error C2062: type 'bool' unexpected (compiling source file UtilsTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(56,2): error C2059: syntax error: '>' (compiling source file LangUtilsTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2143: syntax error: missing ';' before '{' (compiling source file PredictionBase.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(57,1): error C3770: 'unknown-type': is not a valid base class (compiling source file JavaPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(56,30): error C7568: argument list missing after assumed function template 'callable_with' (compiling source file PythonPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(58): message : see reference to class template instantiation 'boost::asio::detail::is_completion_handler_for<T,R(Args...)>' being compiled (compiling source file PythonPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(56,2): error C2059: syntax error: '>' (compiling source file ExecutorTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2143: syntax error: missing ';' before '{' (compiling source file UtilsTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(57,1): error C3770: 'unknown-type': is not a valid base class (compiling source file LangUtilsTest.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2447: '{': missing function header (old-style formal list?) (compiling source file PredictionBase.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(63,1): error C2062: type 'bool' unexpected (compiling source file JavaPredictionTests.cpp)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(56,2): error C2059: syntax error: '>' (compiling source file PythonPredictionTests.cpp)

image

The error is definitely reproducible. Another coworker of mine also faces the same issue.

@felixhao28
Copy link
Author

The full error log for reference:
boost1.72.0vscppstdlatest.txt

@felixhao28
Copy link
Author

felixhao28 commented Feb 6, 2020

I found a minimal reproducible case:

#include <boost/asio.hpp>

int main() {
	return 0;
}

Compiling this with /std:c++latest gives:

image

1>------ Build started: Project: Project1, Configuration: Debug x64 ------
1>Source.cpp
1>Please define _WIN32_WINNT or _WIN32_WINDOWS appropriately. For example:
1>- add -D_WIN32_WINNT=0x0601 to the compiler command line; or
1>- add _WIN32_WINNT=0x0601 to your project's Preprocessor Definitions.
1>Assuming _WIN32_WINNT=0x0601 (i.e. Windows 7 target).
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(44,1): error C2062: type 'bool' unexpected
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2143: syntax error: missing ';' before '{'
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(45,1): error C2447: '{': missing function header (old-style formal list?)
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(56,30): error C7568: argument list missing after assumed function template 'callable_with'
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(58): message : see reference to class template instantiation 'boost::asio::detail::is_completion_handler_for<T,R(Args...)>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\chrono(632): message : see reference to class template instantiation 'std::chrono::duration<double,std::ratio<1,1>>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\chrono(178): message : see reference to class template instantiation 'std::chrono::duration<__int64,std::nano>' being compiled
1>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.24.28314\include\chrono(610): message : see reference to class template instantiation 'std::chrono::time_point<std::chrono::steady_clock,std::chrono::nanoseconds>' being compiled
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(56,2): error C2059: syntax error: '>'
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(57,1): error C3770: 'unknown-type': is not a valid base class
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(63,1): error C2062: type 'bool' unexpected
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(64,35): error C2065: 'T': undeclared identifier
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(64,11): error C2923: 'boost::asio::detail::is_completion_signature': 'T' is not a valid template type argument for parameter 'T'
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(64,39): error C2955: 'boost::asio::detail::is_completion_signature': use of class template requires template argument list
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(34): message : see declaration of 'boost::asio::detail::is_completion_signature'
1>D:\dev\boost_1_72_0\boost\asio\async_result.hpp(69,44): error C2061: syntax error: identifier 'completion_signature'
...

@mclow mclow transferred this issue from boostorg/boost Feb 6, 2020
@felixhao28
Copy link
Author

This might be a duplicate of #312

@velia-ai
Copy link

I experienced the exact same problem and confirm that boost 1.72.0 w/ VS-2019 compiled fine when the language flag is set to /std:c++17 but failed when set to /std:c++latest

@ghost
Copy link

ghost commented Dec 30, 2020

This issue was moved by chriskohlhoff to chriskohlhoff/asio#747.

@ghost ghost closed this as completed Dec 30, 2020
@boostorg boostorg locked and limited conversation to collaborators Dec 30, 2020
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants