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

gtest.h generates error on visual studio 2017 #1036

Closed
bmanga opened this issue Mar 2, 2017 · 10 comments
Closed

gtest.h generates error on visual studio 2017 #1036

bmanga opened this issue Mar 2, 2017 · 10 comments

Comments

@bmanga
Copy link

bmanga commented Mar 2, 2017

gtest.h produces error when using visual studio 2017 with the latest standard compiler switch (/std:c++latest). This is because the switch removes the tr1 namespace (while the __cplusplus macro value is still 199711L). Hence gtest fails looking for std::tr1::tuple and friends.
This can be worked around by defining GTEST_HAS_TR1_TUPLE to 0 and GTEST_HAS_STD_TUPLE to 1, although it would be nice if gtest could figure it out itself.

@KindDragon
Copy link
Contributor

Can you try with PR #811?

@bmanga
Copy link
Author

bmanga commented Mar 4, 2017

That works, thanks! Any reasons why that's not been merged yet?

@KindDragon
Copy link
Contributor

IDK, no one responding :)

@KindDragon
Copy link
Contributor

Can be closed. PR #1218 fixed this

@tobiaskohlbau
Copy link

tobiaskohlbau commented Dec 1, 2017

Looks like it's not fixed by #1218. With VS 15.5 Preview 5 I still get the warning.

googletest\googletest\include\gtest/gtest-printers.h(617): warning C4996: 'std::tr1': warning STL4002: The non-Standard std::tr1 namespace and TR1-only machinery are deprecated and will be REMOVED. You can define _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING to acknowledge that you have received this warning.

Edit:
Checked with VS 15.4 and it's compiling fine. Maybe this Release Notes help to identify the issue.

@Shawn1874
Copy link

It doesn't look fixed to me. The latest google test available via NUGET is 1.8.2. It's clearly not fixed or the fix hasn't been formally released yet.

@giladreich
Copy link

Definitely not fixed yet.

@ClassyCircuit
Copy link

Still not fixed.

@p-groarke
Copy link

You can use /Zc:__cplusplus to fix this.

@gennadiycivil
Copy link
Contributor

TR1 is gone now, closing

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

8 participants