This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Mar 2004 18:15:39 -0000
- Subject: [Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Here is a regression on 3.4 and 3.5 that breaks my nightly builds.
Must be rather recent, i.e. in the last couple of days...
-----------------
enum E { e };
E & operator |= (E &f1, const E &f2);
E operator | (const E &f1, const E &f2) {
E result = f1;
result |= f2;
return result;
}
template <typename> void foo () {
const E flags = e | e;
}
template void foo<double> ();
-------------------
deal.II/deal.II> /workspace/bangerth/build-gcc-3.4/gcc-install/bin/c++ -c x.cc
x.cc: In function `void foo() [with number = double]':
x.cc:19: instantiated from here
x.cc:16: warning: taking address of temporary
x.cc:16: warning: taking address of temporary
That's bogus. Beside, I'm a little annoyed that nobody ever came around
to fix the doubled warning messages despite the fact that we have been
seeing and reporting them for months. But that's another story. For now,
the above thing breaks my -Werror builds.
W.
--
Summary: [3.4/3.5 regression] Bogus warning in templates about
taking address of a temporary
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bangerth at dealii dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14586