online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
#include <cstdio> #include <locale> #include <cassert> #include <sstream> using namespace std; auto getPCTMRequiresLeadingZeroBug = [] () { static constexpr wstring_view kMonthDayYearFormat = L"%m/%d/%Y"sv; std::locale l = locale::classic (); const time_get<wchar_t>& tmget = use_facet<time_get<wchar_t>> (l); ios::iostate state = ios::goodbit; wistringstream iss (L"11/1/2002"); istreambuf_iterator<wchar_t> itbegin (iss); // beginning of iss istreambuf_iterator<wchar_t> itend; // end-of-stream tm resultTM{}; auto i = tmget.get (itbegin, itend, iss, state, &resultTM, kMonthDayYearFormat.data (), kMonthDayYearFormat.data () + kMonthDayYearFormat.length ()); #if qCompilerAndStdLib_locale_time_get_PCTM_RequiresLeadingZero_Buggy assert ((state & ios::badbit) or (state & ios::failbit)); #else assert (not((state & ios::badbit) or (state & ios::failbit))); #endif }; int main() { getPCTMRequiresLeadingZeroBug(); printf("Hello World"); return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue