Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionVinícius Ferrão
2021-10-05 17:17:02 UTC
Description of problem:
It seems that starts_with(); method from std::string is missing on EL8.4 even when we use --std=c++2a with gcc (or clang). Both compilers supports C++20 but it seems the implementation is missing from libstdc++.
[root@localhost ~]# g++ --std=c++2a starts_with.c
starts_with.c: In function 'int main()':
starts_with.c:6:19: error: 'std::__cxx11::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with'
std::cout << var.starts_with("is") << std::endl;
^~~~~~~~~~~
Version-Release number of selected component (if applicable):
gcc-c++-8.4.1-1.el8.x86_64
clang-devel-11.0.0-1.module+el8.4.0+8598+a071fcd5.x86_64
libstdc++-8.4.1-1.el8.x86_64
libgcc-8.4.1-1.el8.x86_64
clang-tools-extra-11.0.0-1.module+el8.4.0+8598+a071fcd5.x86_64
clang-11.0.0-1.module+el8.4.0+8598+a071fcd5.x86_64
gcc-8.4.1-1.el8.x86_64
clang-libs-11.0.0-1.module+el8.4.0+8598+a071fcd5.x86_64
libstdc++-devel-8.4.1-1.el8.x86_64
How reproducible:
100%
Steps to Reproduce:
1. Create an example program with std::string and use the method starts_with();
2. Fail to compile with bundled gcc and libstdc++
Actual results:
Compiler error during compile phase.
Expected results:
Successful compilation.
Additional info:
std::string starts_with() is defined on C++20: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0457r2.html
It should be supported if we have the option to enable --std=c++2a on compilers.
Example code:
#include <string>
#include <iostream>
int main() {
std::string var = "this is a test";
std::cout << var.starts_with("is") << std::endl;
return 0;
}
Description of problem: It seems that starts_with(); method from std::string is missing on EL8.4 even when we use --std=c++2a with gcc (or clang). Both compilers supports C++20 but it seems the implementation is missing from libstdc++. [root@localhost ~]# g++ --std=c++2a starts_with.c starts_with.c: In function 'int main()': starts_with.c:6:19: error: 'std::__cxx11::string' {aka 'class std::__cxx11::basic_string<char>'} has no member named 'starts_with' std::cout << var.starts_with("is") << std::endl; ^~~~~~~~~~~ Version-Release number of selected component (if applicable): gcc-c++-8.4.1-1.el8.x86_64 clang-devel-11.0.0-1.module+el8.4.0+8598+a071fcd5.x86_64 libstdc++-8.4.1-1.el8.x86_64 libgcc-8.4.1-1.el8.x86_64 clang-tools-extra-11.0.0-1.module+el8.4.0+8598+a071fcd5.x86_64 clang-11.0.0-1.module+el8.4.0+8598+a071fcd5.x86_64 gcc-8.4.1-1.el8.x86_64 clang-libs-11.0.0-1.module+el8.4.0+8598+a071fcd5.x86_64 libstdc++-devel-8.4.1-1.el8.x86_64 How reproducible: 100% Steps to Reproduce: 1. Create an example program with std::string and use the method starts_with(); 2. Fail to compile with bundled gcc and libstdc++ Actual results: Compiler error during compile phase. Expected results: Successful compilation. Additional info: std::string starts_with() is defined on C++20: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0457r2.html It should be supported if we have the option to enable --std=c++2a on compilers. Example code: #include <string> #include <iostream> int main() { std::string var = "this is a test"; std::cout << var.starts_with("is") << std::endl; return 0; }