public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14586] [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary
2004-03-15 18:15 [Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary bangerth at dealii dot org
@ 2004-03-15 18:15 ` bangerth at dealii dot org
2004-03-15 18:27 ` [Bug c++/14586] [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary in a template pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-03-15 18:15 UTC (permalink / raw)
To: gcc-bugs
--
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14586
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary
@ 2004-03-15 18:15 bangerth at dealii dot org
2004-03-15 18:15 ` [Bug c++/14586] " bangerth at dealii dot org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-03-15 18:15 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14586] [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary in a template
2004-03-15 18:15 [Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary bangerth at dealii dot org
2004-03-15 18:15 ` [Bug c++/14586] " bangerth at dealii dot org
@ 2004-03-15 18:27 ` pinskia at gcc dot gnu dot org
2004-03-15 18:34 ` bangerth at dealii dot org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-03-15 18:27 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-03-15 18:27 -------
Confirmed. It only happens in templates.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Known to fail| |3.4.0 3.5.0
Known to work| |3.3.3
Last reconfirmed|0000-00-00 00:00:00 |2004-03-15 18:27:22
date| |
Summary|[3.4/3.5 regression] Bogus |[3.4/3.5 regression] Bogus
|warning in templates about |warning in templates about
|taking address of a |taking address of a
|temporary |temporary in a template
Target Milestone|3.4.0 |3.4.1
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14586
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14586] [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary in a template
2004-03-15 18:15 [Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary bangerth at dealii dot org
2004-03-15 18:15 ` [Bug c++/14586] " bangerth at dealii dot org
2004-03-15 18:27 ` [Bug c++/14586] [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary in a template pinskia at gcc dot gnu dot org
@ 2004-03-15 18:34 ` bangerth at dealii dot org
2004-03-16 21:35 ` cvs-commit at gcc dot gnu dot org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-03-15 18:34 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-03-15 18:34 -------
Hm, Mark, this is such a recent regression that I believe this should actually
be fixed for 3.4.0, not 3.4.1. It is not a bug that is out there for
a longer time to which people could adjust, and it is also something
that can't be worked around. I'd hate to have this in a release...
W.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmitchel at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14586
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14586] [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary in a template
2004-03-15 18:15 [Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary bangerth at dealii dot org
` (2 preceding siblings ...)
2004-03-15 18:34 ` bangerth at dealii dot org
@ 2004-03-16 21:35 ` cvs-commit at gcc dot gnu dot org
2004-03-16 22:18 ` cvs-commit at gcc dot gnu dot org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-16 21:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-03-16 21:35 -------
Subject: Bug 14586
CVSROOT: /cvs/gcc
Module name: gcc
Branch: gcc-3_4-branch
Changes by: mmitchel@gcc.gnu.org 2004-03-16 21:35:18
Modified files:
gcc/testsuite : ChangeLog
gcc/cp : ChangeLog call.c cp-tree.h decl2.c parser.c
pt.c semantics.c typeck.c typeck2.c
Added files:
gcc/testsuite/g++.dg/parse: non-dependent3.C
Log message:
PR c++/14586
* cp-tree.h (build_new_op): Change prototype.
(build_x_binary_op): Likewise.
* call.c (build_new_op): Add overloaded_p parameter.
* decl2.c (grok_array_decl): Adjust call to build_new_op.
* parser.c (cp_parser_binary_expression): Note that uses of
overloaded operators prevents an expression from being considered
an integral constant.
* pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
build_x_binary_op.
* semantics.c (finish_call_expr): Likewise.
* typeck.c (rationalize_conditional_expr): Likewise.
(build_x_indirect_ref): Likewise.
(build_x_binary_op): Likewise.
(build_x_unary_op): Likewise.
(build_x_compound_expr): Likewise.
(build_modify_expr): Likewise.
* typeck2.c (build_x_arrow): Likewise.
PR c++/14586
* g++.dg/parse/non-dependent3.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.145&r2=1.3389.2.146
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/non-dependent3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.82&r2=1.3892.2.83
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.452.2.12&r2=1.452.2.13
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.946.4.9&r2=1.946.4.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.695.4.4&r2=1.695.4.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.21&r2=1.157.2.22
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.18&r2=1.816.2.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.381.4.8&r2=1.381.4.9
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.519.2.9&r2=1.519.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.153.4.1&r2=1.153.4.2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14586
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14586] [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary in a template
2004-03-15 18:15 [Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary bangerth at dealii dot org
` (3 preceding siblings ...)
2004-03-16 21:35 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-16 22:18 ` cvs-commit at gcc dot gnu dot org
2004-03-16 22:26 ` mmitchel at gcc dot gnu dot org
2004-03-16 22:29 ` bangerth at dealii dot org
6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-03-16 22:18 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-03-16 22:18 -------
Subject: Bug 14586
CVSROOT: /cvs/gcc
Module name: gcc
Changes by: mmitchel@gcc.gnu.org 2004-03-16 22:18:12
Modified files:
gcc/cp : ChangeLog call.c cp-tree.h decl2.c parser.c
pt.c semantics.c typeck.c typeck2.c
gcc/testsuite : ChangeLog
Added files:
gcc/testsuite/g++.dg/parse: non-dependent3.C
Log message:
PR c++/14586
* cp-tree.h (build_new_op): Change prototype.
(build_x_binary_op): Likewise.
* call.c (build_new_op): Add overloaded_p parameter.
* decl2.c (grok_array_decl): Adjust call to build_new_op.
* parser.c (cp_parser_binary_expression): Note that uses of
overloaded operators prevents an expression from being considered
an integral constant.
* pt.c (tsubst_copy_and_build): Adjust calls to build_new_op and/or
build_x_binary_op.
* semantics.c (finish_call_expr): Likewise.
* typeck.c (rationalize_conditional_expr): Likewise.
(build_x_indirect_ref): Likewise.
(build_x_binary_op): Likewise.
(build_x_unary_op): Likewise.
(build_x_compound_expr): Likewise.
(build_modify_expr): Likewise.
* typeck2.c (build_x_arrow): Likewise.
PR c++/14586
* g++.dg/parse/non-dependent3.C: New test.
Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3998&r2=1.3999
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.468&r2=1.469
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.957&r2=1.958
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.701&r2=1.702
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.182&r2=1.183
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.839&r2=1.840
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.389&r2=1.390
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.531&r2=1.532
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck2.c.diff?cvsroot=gcc&r1=1.154&r2=1.155
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3608&r2=1.3609
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/non-dependent3.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14586
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14586] [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary in a template
2004-03-15 18:15 [Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary bangerth at dealii dot org
` (4 preceding siblings ...)
2004-03-16 22:18 ` cvs-commit at gcc dot gnu dot org
@ 2004-03-16 22:26 ` mmitchel at gcc dot gnu dot org
2004-03-16 22:29 ` bangerth at dealii dot org
6 siblings, 0 replies; 8+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2004-03-16 22:26 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From mmitchel at gcc dot gnu dot org 2004-03-16 22:26 -------
Fixed in GCC 3.4 and GCC 3.5.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
Target Milestone|3.4.1 |3.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14586
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/14586] [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary in a template
2004-03-15 18:15 [Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary bangerth at dealii dot org
` (5 preceding siblings ...)
2004-03-16 22:26 ` mmitchel at gcc dot gnu dot org
@ 2004-03-16 22:29 ` bangerth at dealii dot org
6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-03-16 22:29 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2004-03-16 22:29 -------
Thanks, Mark, your responsiveness is greatly appreciated!
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14586
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-03-16 22:29 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-15 18:15 [Bug c++/14586] New: [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary bangerth at dealii dot org
2004-03-15 18:15 ` [Bug c++/14586] " bangerth at dealii dot org
2004-03-15 18:27 ` [Bug c++/14586] [3.4/3.5 regression] Bogus warning in templates about taking address of a temporary in a template pinskia at gcc dot gnu dot org
2004-03-15 18:34 ` bangerth at dealii dot org
2004-03-16 21:35 ` cvs-commit at gcc dot gnu dot org
2004-03-16 22:18 ` cvs-commit at gcc dot gnu dot org
2004-03-16 22:26 ` mmitchel at gcc dot gnu dot org
2004-03-16 22:29 ` bangerth at dealii dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).