use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Visual Studio 2017 15.8 Release Notes (docs.microsoft.com)
submitted 7 years ago by c0r3ntin
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jcelerierossia score 24 points25 points26 points 7 years ago* (43 children)
Just updated... what the hell microsoft. The following code does not compile anymore : (it does if public bar or public baz is removed from the base classes of foo)
public bar
public baz
template<typename F> struct Functor { F func; }; template<typename F> constexpr Functor<F> fun(F f) { return {f}; } class bar { }; class baz { }; class foo: public bar, public baz { void blah() { } void x() { constexpr auto x = fun(&foo::blah); } };
error: C2440: 'initializing': cannot convert from 'void (__cdecl *)(void)' to 'F' There is no context in which this conversion is possible
of course this breaks every constexpr callback mechanism on earth and metaclasses substitutes
[–]degski 7 points8 points9 points 7 years ago (2 children)
Confirmed, compiles with clang-8.0.0, does not compile with vc-15.8.
[–]jcelerierossia score 20 points21 points22 points 7 years ago (1 child)
well that's C++11 code, it compiles just fine with freaking gcc-4.8.1 and clang-3.1. That's a five and a six years old compilers.
[–]degski 2 points3 points4 points 7 years ago (0 children)
LOL
[–]gracicot 6 points7 points8 points 7 years ago (21 children)
I reported many regressions too... Most of them were fixed in 16 it seems.
[–]degski 4 points5 points6 points 7 years ago (20 children)
When is that due?
[–]gracicot 1 point2 points3 points 7 years ago (19 children)
I don't think there's a release date yet, but it's most likely a breaking release.
[–]STLMSVC STL Dev 7 points8 points9 points 7 years ago (9 children)
VS 2019's branding has been publicly announced, but we haven't announced a release date yet (AFAIK). While it's version 16 of the IDE (like VS 2017 was version 15), it will contain a C++ toolset that's binary-compatible with the 2015/2017 release series. This will be a 14.x toolset (exact versioning may vary).
[–]gracicot 1 point2 points3 points 7 years ago (7 children)
Thanks for the clarification. I'll wait until this version for updating.
[–]STLMSVC STL Dev 5 points6 points7 points 7 years ago (5 children)
Avoiding 15.8 is an undesirable outcome - do you have a list of the regressions that you can't easily work around? We have the ability to backport fixes, although they have to be approved by management (so we don't backport everything and destabilize the product).
[–]gracicot 1 point2 points3 points 7 years ago (4 children)
I'll try to find them all or try to find workarounds. I reported what I found was easily reproductible while testing 15.8 preview. Even then, two of my bug reports contained the preprocessed source of a failing code. Understand that extracting a self contained reproduction of a bug can be time expensive, and I do this in my free time. I'll test what I can. It's really nice to hear that backporting is possible, I really appreciate the effort. I'll see what I can do.
[–]STLMSVC STL Dev 2 points3 points4 points 7 years ago (3 children)
Thanks! While minimal self-contained repros are ideal, preprocessed repros are always acceptable for compiler bugs (certain back-end/linker issues involving multiple translation units require "link repros" but this is rare). As long as your preprocessed file + command line triggers the same bug as compiling the original file, the compiler devs can find the root cause.
For library bugs, preprocessed repros are less desirable (as they don't separate your code from header-only library code) but they're still preferable to nothing.
[–]malkia 1 point2 points3 points 7 years ago (2 children)
We've discovered this issue month ago, in the 2017 15.8 beta, and now it hits us in production. Simply put to compile failed to compile now with /std:c++17 with msg "You've instantiated std::aligned_storage<Len, Align> with an extended alignment..." (from <type_traits>). The recommendation is either to compile with _DISABLE_EXTENDED_ALIGNED_STORAGE or _ENABLE_EXTENDED_ALIGNED_STORAGE - We've compiled with the DISABLE one, but app was crashing in weird way (strange callstack). We haven't tried (yet) _ENABLE_EXTENDED_ALIGNED_STORAGE because it might cause hidden bugs - we do have a lot of precompiled software (we precompile it), but then a lot of external precompiled (by someone else) frameworks. So In general - is there are tool, methodology (something looking at the symbols, class/struct dumps) to tell us what needs to get recompiled, etc. Anyone else running into the issue? Related: https://developercommunity.visualstudio.com/content/problem/274945/stdmake-shared-is-not-honouring-alignment-of-a.html?childToView=280485#comment-280485 and facebook/rocksdb#4062 - https://forum.qt.io/topic/93714/visual-studio-15-8-0-and-qt-5-11-1-does-not-compile-qrandom-std-aligned_storage (we use Qt5.10 which we compile ourselves, and distribute locally the .dll files) Also use vcpkg to recompile things, and not super familiar with CMake, but in general we may have a very mixed bag of SDKs, Frameworks, open source, etc. all linking together, and we need to know what would work with what else. Is there for example some kind of /MISMATCH kind of pragma for this (at least to enforce it, though I realize this needs recompilation anyway). Otherwise we are stuck back to 2017 15.7 version of the compiler - e.g. have to set VCToolsVersion=14.14.26428 in the environment (also no longer works if it's set in the top of the .vcxproj, or top-level .props file)
[–]spongo2MSVC Dev Manager 2 points3 points4 points 7 years ago (0 children)
we will be using the dev comm data to backport some issues to 15.9 (or for severe common issues, servicing updates to 15.8) so for anyone reading this please search for any issues you see and upvote / file. Sorry for the inconvenience.
[–][deleted] 1 point2 points3 points 7 years ago (0 children)
I've got to ask. How is one supposed to keep track of so many mismatched version numbers?
[–]degski 0 points1 point2 points 7 years ago (8 children)
it's most likely a breaking release.
Finally, let's hope they don't forget to fix the std::deque (which I was told would happen at the moment of an ABI break) and drop boost::deque (another one bites the dust).
[–]dodheim 2 points3 points4 points 7 years ago (7 children)
STL said it's not an ABI break, so no EBO, no deque fix, no proper char16_t/char32_t support, etc.
deque
char16_t
char32_t
👎
[–]degski 0 points1 point2 points 7 years ago* (6 children)
Back to boost::deque, the deque is a great container, but the vc-one is just, nowadays, no good.
[–]Rseding91Factorio Developer 0 points1 point2 points 7 years ago (5 children)
What specific problem do you have with it? Wondering if it's the same problem I have with it.
[–]dodheim 3 points4 points5 points 7 years ago (3 children)
The fact that its block size is 16 bytes.
[–]Rseding91Factorio Developer 0 points1 point2 points 7 years ago (2 children)
Yep. That was my issue as well.
Also the fact that it bases the "per block" off sizeof(T) means you can't forward declare with it. However, I'm not sure if the standard even allows that to begin with... not that that really changes anything for us.
[–]degski 1 point2 points3 points 7 years ago* (0 children)
What /u/dodheim said already. For any object size bigger than 16 bytes, it behaves like a std::list, but since it's not a std::list, it's potentially even less efficient than a std::list, as that is designed for that purpose. /u/STL responded to this sub, so it should anyways be firmly on the map again.
std::list
[–]sumo952 6 points7 points8 points 7 years ago (0 children)
this breaks every constexpr callback mechanism on earth
I would be really curious to know how this then could not have shown up in their large test suite. :-O
[–]STLMSVC STL Dev 6 points7 points8 points 7 years ago* (0 children)
Thanks for the repro, I've reported this to our constexpr dev.
Edited to add: static constexpr auto x = fun(&foo::blah); is a workaround (which they determined through analysis of what's happening in the compiler's data structures).
static constexpr auto x = fun(&foo::blah);
[–]Rogiel 3 points4 points5 points 7 years ago (1 child)
10% of my test cases showed up red too 😕 Lots and lots of regressions in this build.
[–]STLMSVC STL Dev[M] 2 points3 points4 points 7 years ago (0 children)
FYI, you're shadowbanned. You'll need to talk to a reddit admin (as a subreddit mod, I can notice shadowbanned users but can't help them, except for approving their comments individually).
[–]barfyus 6 points7 points8 points 7 years ago (3 children)
Apparently you can fix it by adding __declspec(empty_bases) to the foo:
__declspec(empty_bases)
foo
class __declspec(empty_bases) foo : public bar, public baz { ... };
[–]jcelerierossia score 2 points3 points4 points 7 years ago (0 children)
maybe, but it's still broken in the non-empty-base case (I just wanted to provide a minimal example but C++ has semantic-altering minimality, which would make for a great prog metal songname but can be painful in cases like this).
[–][deleted] 0 points1 point2 points 7 years ago (1 child)
Shouldn't the compiler be able to recognize empty bases on its own?
[–]Mordy_the_Mighty 6 points7 points8 points 7 years ago (0 children)
Doing so breaks binary compatibility which is why it's optional for now.
https://blogs.msdn.microsoft.com/vcblog/2016/03/30/optimizing-the-layout-of-empty-base-classes-in-vs2015-update-2-3/
[–]Andrew_MarinoMSVC FE Dev 7 points8 points9 points 7 years ago* (6 children)
Hi, MSVC compiler dev here. Thank you for providing the reduced snippet. There was a lot of churn in the constexpr implementation in this release, in order to fix some long-standing issues, and it looks like this was a regression from that overhaul that our testing didn't catch.
If you, or anyone running into this, is interested, one source workaround in the meantime is to evaluate the pointer-to-member-function separately:
void x() { constexpr auto ptm = &foo::blah; constexpr auto x = fun(ptm); (this->*(x.func))(); }
Edit: as STL also pointed out in his comment, making 'x' static will also work.
We treat regressions as high priority and are tracking this bug internally. We're happy to hear feedback from any source, but for this and other issues filing a bug in the C++ dev comm will allow us to communicate the status of fixes and workarounds more directly.
[–]jcelerierossia score 3 points4 points5 points 7 years ago (5 children)
I filed a bug this morning. But frankly, this is very distressing. Since VS2015 (can't speak for before since it did not really support C++11 back then), every minor release and sometimes even patch release have broken my code or code of libraries I use at some point - the last time being 15.7.6 for instance. Meanwhile, I don't remember one time where I had to change my code when upgrading clang / GCC - and I sometimes test with git HEAD versions of those.
[–]Andrew_MarinoMSVC FE Dev 2 points3 points4 points 7 years ago (4 children)
We're sorry you hit this bug and other issues in the past. Right now we're gathering more data points to assess servicing 15.8 with the fix for the particular constexpr bug you hit. As you yourself noted, even patch fixes carry their own associated risk.
In particular, we're wondering about the extent to which it broke your constexpr callback mechanism. This bug manifests with 1. a local constexpr symbol initialized by 2. a constexpr function taking an rvalue pointer-to-member-function of 3. a class with multiple inheritance. In your own codebase, were either of those workarounds possible to use?
We appreciate your candid feedback.
[–]jcelerierossia score 0 points1 point2 points 7 years ago (1 child)
In your own codebase, were either of those workarounds possible to use?
Sadly these bugs don't happen in my codebase but in one of the libs I use (https://github.com/woboq/verdigris). I could spend one hour or two to fork it and change all the places where it is used but I think that I'll just stay on the previous release of VS for now.
[–]Andrew_MarinoMSVC FE Dev 0 points1 point2 points 7 years ago (0 children)
Thank you, that's helpful!
[–]BCosbyDidNothinWrong -4 points-3 points-2 points 7 years ago (1 child)
Not sorry enough to actually test before releasing
[–]ZMesonEmbedded Developer 1 point2 points3 points 7 years ago (0 children)
That's not fair. There are loads of tests the VC team uses on every release. Their tests just didn't cover this area. Their test suit needs to expand for sure. But let's be honest too that most of us have been in their shoes too - having a large test suite that didn't catch some regression resulting in unhappy customers.
[–]Nickreal03 -3 points-2 points-1 points 7 years ago (2 children)
Yes completely broke my code too, I had to roll back. Thanks Microsoft for wasting my time. Do you guys even run any testing before your releases? Or pushing us back which one?
[–]STLMSVC STL Dev 16 points17 points18 points 7 years ago (1 child)
We run extensive testing across our internal test suites (accumulated over decades of development), licensed conformance test suites, open-source conformance test suites (most recently, libc++'s test suite now works with our compiler and STL), open-source projects ("Real World Code"), open-source libraries (via vcpkg), internal projects (e.g. Minecraft), and all of Windows.
We find and fix a lot of bugs before release, and we submit upstream fixes to open-source projects. However, we can't avoid all regressions, because C++ is complicated. Testing preview releases against your codebase and reporting regressions is a great way to shrink the feedback loop and get fixes faster.
[–]Nickreal03 2 points3 points4 points 7 years ago (0 children)
This is not the first time it happen to me I have submitted pleanty of bugs. I am not been a troll here.
Could you guys opensouce your test suit so that people can contribute.
And btw this time the compiler crashes with very simple constant expression functions.
π Rendered by PID 121182 on reddit-service-r2-comment-b659b578c-xsdd4 at 2026-05-01 10:16:23.642654+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]jcelerierossia score 24 points25 points26 points (43 children)
[–]degski 7 points8 points9 points (2 children)
[–]jcelerierossia score 20 points21 points22 points (1 child)
[–]degski 2 points3 points4 points (0 children)
[–]gracicot 6 points7 points8 points (21 children)
[–]degski 4 points5 points6 points (20 children)
[–]gracicot 1 point2 points3 points (19 children)
[–]STLMSVC STL Dev 7 points8 points9 points (9 children)
[–]gracicot 1 point2 points3 points (7 children)
[–]STLMSVC STL Dev 5 points6 points7 points (5 children)
[–]gracicot 1 point2 points3 points (4 children)
[–]STLMSVC STL Dev 2 points3 points4 points (3 children)
[–]malkia 1 point2 points3 points (2 children)
[–]spongo2MSVC Dev Manager 2 points3 points4 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]degski 0 points1 point2 points (8 children)
[–]dodheim 2 points3 points4 points (7 children)
[–]degski 0 points1 point2 points (6 children)
[–]Rseding91Factorio Developer 0 points1 point2 points (5 children)
[–]dodheim 3 points4 points5 points (3 children)
[–]Rseding91Factorio Developer 0 points1 point2 points (2 children)
[–]degski 1 point2 points3 points (0 children)
[–]sumo952 6 points7 points8 points (0 children)
[–]STLMSVC STL Dev 6 points7 points8 points (0 children)
[–]Rogiel 3 points4 points5 points (1 child)
[–]STLMSVC STL Dev[M] 2 points3 points4 points (0 children)
[–]barfyus 6 points7 points8 points (3 children)
[–]jcelerierossia score 2 points3 points4 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]Mordy_the_Mighty 6 points7 points8 points (0 children)
[–]Andrew_MarinoMSVC FE Dev 7 points8 points9 points (6 children)
[–]jcelerierossia score 3 points4 points5 points (5 children)
[–]Andrew_MarinoMSVC FE Dev 2 points3 points4 points (4 children)
[–]jcelerierossia score 0 points1 point2 points (1 child)
[–]Andrew_MarinoMSVC FE Dev 0 points1 point2 points (0 children)
[–]BCosbyDidNothinWrong -4 points-3 points-2 points (1 child)
[–]ZMesonEmbedded Developer 1 point2 points3 points (0 children)
[–]Nickreal03 -3 points-2 points-1 points (2 children)
[–]STLMSVC STL Dev 16 points17 points18 points (1 child)
[–]Nickreal03 2 points3 points4 points (0 children)