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

The MSVC11 (Visual Studio 2012) throw std::tuple error when compiling #148

Closed
LevskiWeng opened this issue Apr 12, 2015 · 3 comments
Closed

Comments

@LevskiWeng
Copy link

When compiling in MSVC11, the compiler said:

error C2977: 'std::tuple' : too many template arguments

I've googled the error message, and according to the stackoverflow post, I added the following preprocessor to all cppformat projects:

_VARIADIC_MAX=10

and then it compiled successfully.

I wonder is it a good idea for the project maintainers add the above preprocessor to the default CMakefile.txt when CMake found that the build environment is MSVC11?

@vitaut
Copy link
Contributor

vitaut commented Apr 12, 2015

Thanks for the bug report. I don't have access to MSVC11 at the moment, but I think cea6413 should fix the problem. Could you please check if it does?

@LevskiWeng
Copy link
Author

Thanks for your quick patch. But I'm afraid your patch doesn't work for me.

I replaced your modified CMakeLists.txt and tested the following cmake command:

cmake "C:\Absolute path of cppformat source directory"

But I failed to compile the solution again with the same compilation error.

I roughly glanced at the build-in implementation of std::tuple<> in MSVC11, it uses macro to expand the number to template parameters (MSVC11 seems not able to fully support variadic templates). The default max supported number of template parameters in my environment is 8, so the compiler complained 'std::tuple' : too many template arguments only when the number of template parameter exceeded 8 (Line 9741 in cppformat/gmock/gtest/gtest.h)

Any better ideas?

@vitaut
Copy link
Contributor

vitaut commented Apr 12, 2015

OK, should be fixed in 0963fd0. Thanks again for reporting.

@vitaut vitaut closed this as completed Apr 12, 2015
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

2 participants