After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733752 - Unit tests should enable C++11 lambda expression cases when compiling with Visual Studio 2012, 2013
Unit tests should enable C++11 lambda expression cases when compiling with Vi...
Status: RESOLVED FIXED
Product: libsigc++
Classification: Bindings
Component: tests
2.2.x
Other Windows
: Normal enhancement
: ---
Assigned To: libsigc++ maintainer(s)
libsigc++ maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-07-25 17:27 UTC by Ryan Beasley
Modified: 2014-07-29 07:37 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Enable C++11 lambda expressions when compiling with Microsoft Visual Studio 2012 and later. (1.34 KB, patch)
2014-07-25 17:27 UTC, Ryan Beasley
none Details | Review

Description Ryan Beasley 2014-07-25 17:27:02 UTC
Created attachment 281715 [details] [review]
Enable C++11 lambda expressions when compiling with Microsoft Visual Studio 2012 and later.

Testing a patch set for bug 724496 with Visual Studio 2013, I observed that the test_cpp11_lambda and test_track_obj unit tests emitted the message "The compiler capabilities don't allow test of C++11 lambda expressions."  Visual Studio 2012 and 2013 support C++11 lambdas, so I've attached a patch which defines USING_CPP11_LAMBDA_EXPRESSIONS when _MSCVER >= 1700 (Visual Studio 2012 or later).
Comment 1 Kjell Ahlstedt 2014-07-26 07:37:40 UTC
Why is this necessary? What's the value of __cplusplus?

If Visual Studio 2012 and 2013 support C++11, they should
  #define __cplusplus 201103L

g++ 4.8.2 and clang++ 3.4 without extra compiler options set
__cplusplus = 199711.
With the compiler option -std=c++11 they define __GXX_EXPERIMENTAL_CXX0X__
and set __cplusplus = 201103.

The test for __GXX_EXPERIMENTAL_CXX0X__ is included in the test programs
because some older versions of g++ did not define __cplusplus correctly.
Comment 2 Ryan Beasley 2014-07-28 15:51:57 UTC
(In reply to comment #1)
> Why is this necessary? What's the value of __cplusplus?

__cplusplus is still 199711L.  =/

http://stackoverflow.com/questions/14131454/visual-studio-2012-cplusplus-and-c-11

http://connect.microsoft.com/VisualStudio/feedback/details/763051/a-value-of-predefined-macro-cplusplus-is-still-199711l
Comment 3 Kjell Ahlstedt 2014-07-29 07:37:55 UTC
I have pushed the patch with a modified commit message.
https://git.gnome.org/browse/libsigc++2/commit/?id=a64385ca50b04f17b5edc35b75d83281d503e383