[Bug libstdc++/94749] New: std::istream::ignore discards too many characters
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94749 Bug ID: 94749 Summary: std::istream::ignore discards too many characters Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: serpent7776 at gmail dot com Target Milestone: --- Created attachment 48369 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48369&action=edit full source example The following code results in '=' assigned to c when using libstdc++, but '+' is assigned when using libc++, I believe libc++ is correct here std::stringstream s(" +="); char c; s.ignore(1, '+'); s >> c; Tested this on godbolt with newest gcc and locally on FreeBSD with gcc7 (command: g++7 -Wall -Wextra -pedantic test.cpp) https://godbolt.org/z/yS5je8
[Bug libstdc++/94749] std::istream::ignore discards too many characters
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94749 --- Comment #2 from serpent7776 at gmail dot com --- any update?
[Bug libstdc++/94749] std::istream::ignore discards too many characters
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94749 --- Comment #6 from serpent7776 at gmail dot com --- thanks
[Bug c++/104470] New: internal compiler error: Segmentation fault compiling std::variant with -std=c++20
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104470 Bug ID: 104470 Summary: internal compiler error: Segmentation fault compiling std::variant with -std=c++20 Product: gcc Version: 10.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: serpent7776 at gmail dot com Target Milestone: --- Created attachment 52396 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52396&action=edit Preprocessed source I encountered an internal compiler error while compiling the following code in c++20 mode (no other flags are needed): #include template struct Foo { T value; }; template struct Bar { T value; }; template using V = std::variant, Bar>; int main() { V e = Foo("a"); } When I switch to c++17 mode compiler does not crash. I tested it on g++ 10.3.0 on FreeBSD 12.3-RELEASE-p1, but I can also reproduce it on trunk version here https://godbolt.org/z/vn5Ws14Ma Full error: # g++10 -std=c++20 ice.ii In file included from ice.cpp:1: /usr/local/lib/gcc10/include/c++/variant: In substitution of 'template template using __accepted_type = std::variant<_Types>::__to_type<__accepted_index<_Tp> > [with _Tp = _Tp&&; = typename std::enable_if, Bar >::__not_self<_Tp&&>, void>::type; _Types = {Foo, Bar}]': ice.cpp:20:15: required from here /usr/local/lib/gcc10/include/c++/variant:1335:36: internal compiler error: Segmentation fault 1335 | using __accepted_type = __to_type<__accepted_index<_Tp>>; |^~~~ libbacktrace could not find executable to open
[Bug c++/56958] Spurious set but not used variable warning in empty pack expansion
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56958 serpent7776 at gmail dot com changed: What|Removed |Added CC||serpent7776 at gmail dot com --- Comment #7 from serpent7776 at gmail dot com --- I was just hit by this warning in a very similar scenario. To me this warning in this context is not only unhelpful, but confusing. clang doesn't issue this warning in this context.
[Bug c++/101792] New: Compiling access to templated parent object fails with unrelated message: invalid use of 'auto'
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101792 Bug ID: 101792 Summary: Compiling access to templated parent object fails with unrelated message: invalid use of 'auto' Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: serpent7776 at gmail dot com Target Milestone: --- Sorry for the title, but I don't know how to describe the issue. The following code fails to compile with error message: : In instantiation of 'int fun(Ts ...) [with Ts = {int, int, int}]': :26:10: required from here :21:41: error: invalid use of 'auto' 21 | return pack.template Value<0, int>::value; |~^ Compiler returned: 1 The mentioned line doesn't have `auto`, so it's at best a misleading error message. `auto` from error message refers to the `auto` on previous line. Clang compiles the code without issue. If I remove `template` keyword from offending line, gcc compiles the code without issue. gcc 11.2 x86_64 flags: -std=c++17 -Wall -Wextra -pedantic -O2 #include template struct Value { const T& value; }; template struct Pack; template struct Pack, Ts...> : Value... { }; template int fun(Ts... ts) { auto pack = Pack, Ts...> {{ts}...}; return pack.template Value<0, int>::value; } void f() { fun<>(1, 2, 3); } link to godbolt to see the issue: https://godbolt.org/z/z7so93Wq8