Bogus -Wrestrict in builtin_memcpy from std::string & C++20 on kinetic
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
gcc-defaults (Ubuntu) |
Confirmed
|
Low
|
Unassigned |
Bug Description
The attached cpp file, when built with `g++ -O3 -S --std=c++20 -o test.o gcc-bug-test.cpp -Wall -Werror` on g++12, fails to compile with the following error. Notably, this error requires *both* --std=c++20 and -O3 - it compiles correctly at -O2, and it compiles correctly at -O3 with --std=c++17.
In file included from /usr/include/
In static member function ‘static constexpr std::char_
inlined from ‘static constexpr void std::__
inlined from ‘constexpr std::__
inlined from ‘constexpr std::__
inlined from ‘constexpr std::__
inlined from ‘constexpr std::__
inlined from ‘std::string to_camel_case(const std::string&)’ at gcc-bug-
/usr/include/
431 | return static_
| ~~~~~~~
cc1plus: all warnings being treated as errors
[[Testcase]]
$ cat gcc-bug-test.cpp
#include <string>
std::string to_camel_
{
std::string camel_cased_name;
camel_
return camel_cased_name;
}
$ g++ -O3 -S --std=c++20 -o test.o gcc-bug-test.cpp -Wall -Werror
ProblemType: Bug
DistroRelease: Ubuntu 22.10
Package: g++ 4:12.2.0-1ubuntu1
ProcVersionSign
Uname: Linux 5.19.0-15-generic x86_64
NonfreeKernelMo
ApportVersion: 2.23.0-0ubuntu2
Architecture: amd64
CasperMD5CheckR
Date: Mon Sep 26 16:02:09 2022
InstallationDate: Installed on 2021-06-26 (456 days ago)
InstallationMedia: Ubuntu 21.10.0 2021.05.28 amd64 "bcachefs" (20210622)
SourcePackage: gcc-defaults
UpgradeStatus: Upgraded to kinetic on 2022-09-13 (13 days ago)
Changed in gcc-defaults (Ubuntu): | |
status: | New → Confirmed |
description: | updated |
summary: |
- Bogus -Wrestrict in builtin_memcpy from std::string & C++20 + Bogus -Wrestrict in builtin_memcpy from std::string & C++20 on kinetic |
tags: | added: foundations-todo |
Changed in gcc-defaults (Ubuntu): | |
importance: | Undecided → Low |