[Bug c++/101911] New: Type cannot be defined inside of the lambda in unevaluated context
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101911 Bug ID: 101911 Summary: Type cannot be defined inside of the lambda in unevaluated context Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eligorkadaf at gmail dot com Target Milestone: --- The following code is rejected by gcc: #include int main() { std::vector vec; } gcc claims that types cannot be defined inside of decltype. Hovewer, I did not find anything in standard to confirm such a message in this context. So if you need any proof, proof me please that there is a reason for gcc to claim that first. https://godbolt.org/z/8n6djencY
[Bug c++/101288] Invalid instantiated redeclaration considered valid by gcc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101288 --- Comment #1 from Eligor Kadaf --- Compiler shall provide diagnostics in the current example according to https://eel.is/c++draft/basic.def.odr#15
[Bug c++/101287] Implicit template specialization redefines member function but compiles
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101287 Eligor Kadaf changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #4 from Eligor Kadaf --- I dind't know I have to add a comment to close bug
[Bug c++/101287] Implicit template specialization redefines member function but compiles
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101287 --- Comment #3 from Eligor Kadaf --- I had found this example during the investigation of one another exmaple from real life, which was the bug in clang, and as fas as it is marked as error in standard I had decided it must be compile time error. However, during further investigation of current example I have found it is an ill-formed; no diagnostics required, so I will close this report.
[Bug c++/101288] New: Invalid instantiated redeclaration considered valid by gcc
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101288 Bug ID: 101288 Summary: Invalid instantiated redeclaration considered valid by gcc Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eligorkadaf at gmail dot com Target Milestone: --- https://godbolt.org/z/KG5WG43vE https://eel.is/c++draft/temp.spec#temp.inst-example-4 template struct Outer { template struct Inner; template struct Inner; // #1a template struct Inner { }; // #1b; OK: valid redeclaration of #1a template struct Inner { }; // #2 }; Outer outer; // error at #2 int main() {}
[Bug c++/101287] Implicit template specialization redefines member function but compiles
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101287 --- Comment #2 from Eligor Kadaf --- Agree, and the link was incorrect, so there is a correct one: https://godbolt.org/z/zEz8c7abM
[Bug c++/101287] New: Implicite template specialization redefines member function but compiles
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101287 Bug ID: 101287 Summary: Implicite template specialization redefines member function but compiles Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eligorkadaf at gmail dot com Target Milestone: --- It is exactly an example from the standard, so I don't thin any additional explanations required. https://godbolt.org/z/Ebcc7vsjq https://eel.is/c++draft/temp.spec#temp.inst-example-3
[Bug c++/100862] New: using enum member access fail
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100862 Bug ID: 100862 Summary: using enum member access fail Product: gcc Version: 11.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eligorkadaf at gmail dot com Target Milestone: --- The following code must compile according to C++20 standard. However, gcc fails to compile it enum class fruit { orange, apple }; struct Working { using enum fruit; }; struct Broken { using enum fruit; private: }; int main() { Working::orange; Broken::orange; } Link to godbolt(I don't have gcc-11 installed): https://godbolt.org/z/srYj3sMno Link to C++-draft clause: http://eel.is/c++draft/namespace.udecl#16
[Bug c++/97230] Invocation of non-static member function on a null instance in core constant expression should not be allowed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97230 --- Comment #1 from Eligor Kadaf --- Basically it described in 7th paragraph in [expr.const] of the latest C++ standard draft: https://eel.is/c++draft/expr.const#5
[Bug c++/97230] New: Invocation of non-static member function on a null instance in core constant expression should not be allowed
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97230 Bug ID: 97230 Summary: Invocation of non-static member function on a null instance in core constant expression should not be allowed Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eligorkadaf at gmail dot com Target Milestone: --- The code below should not compile according to the C++ standart. The code: class X{ public: constexpr int foo(){ return 1; } }; int main(){ constexpr auto x = ((X*)nullptr)->foo(); } Compile and run logs: $ g++-10 -v Using built-in specs. COLLECT_GCC=g++-10 COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/10/lto-wrapper OFFLOAD_TARGET_NAMES=nvptx-none:amdgcn-amdhsa:hsa OFFLOAD_TARGET_DEFAULT=1 Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 10-20200411-0ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-10/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-10 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none,amdgcn-amdhsa,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 10.0.1 20200411 (experimental) [master revision bb87d5cc77d:75961caccb7:f883c46b4877f637e0fa5025b4d6b5c9040ec566] (Ubuntu 10-20200411-0ubuntu1) $ g++-10 -Wall -Wextra -std=c++20 bug.cpp bug.cpp: In function ‘int main()’: bug.cpp:10:20: warning: unused variable ‘x’ [-Wunused-variable] 10 | constexpr auto x = ((X*)nullptr)->foo(); |^ There are additional non-issue warnings whether the code is compiled by gcc trunk The godbolt link: https://godbolt.org/z/rx3axf The problem is reproducible with gcc 4.8.1, gcc 5.1 and gcc 8.1 also