[Bug c++/92070] New: [10 regression] -fchecking=2 error: taking address of rvalue
dimhen at gmail dot com
gcc-bugzilla@gcc.gnu.org
Fri Oct 11 18:48:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92070
Bug ID: 92070
Summary: [10 regression] -fchecking=2 error: taking address of
rvalue
Product: gcc
Version: 10.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: dimhen at gmail dot com
Target Milestone: ---
r276763 PASS
r276764 FAIL
clang-8 PASS
$ cat x.ii
struct a;
struct b {
static a c();
};
struct a : b {};
template <class> struct d {
void e() { 0 ? b() : b::c(); }
};
$ g++ -fpreprocessed -fchecking=2 -Wall -Wextra -c x.ii
x.ii: In member function ‘void d< <template-parameter-1-1> >::e()’:
x.ii:7:28: error: taking address of rvalue [-fpermissive]
7 | void e() { 0 ? b() : b::c(); }
| ~~~~^~
x.ii:7:28: error: taking address of rvalue [-fpermissive]
$ clang++ -Wall -c x.ii
More information about the Gcc-bugs
mailing list