public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
[not found] <bug-29234-4@http.gcc.gnu.org/bugzilla/>
@ 2012-09-17 17:54 ` poletti.marco at gmail dot com
2012-09-17 17:57 ` poletti.marco at gmail dot com
` (6 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: poletti.marco at gmail dot com @ 2012-09-17 17:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
poletti.marco at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |poletti.marco at gmail dot
| |com
--- Comment #4 from poletti.marco at gmail dot com 2012-09-17 17:53:36 UTC ---
Still an issue with GCC 4.7.1.
Clang does not have this issue.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
[not found] <bug-29234-4@http.gcc.gnu.org/bugzilla/>
2012-09-17 17:54 ` [Bug c++/29234] Call to operator() of temporary object wrongly parsed poletti.marco at gmail dot com
@ 2012-09-17 17:57 ` poletti.marco at gmail dot com
2012-09-17 17:59 ` poletti.marco at gmail dot com
` (5 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: poletti.marco at gmail dot com @ 2012-09-17 17:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
--- Comment #5 from poletti.marco at gmail dot com 2012-09-17 17:55:54 UTC ---
Still an issue with GCC 4.7.1.
Clang does not have this issue.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
[not found] <bug-29234-4@http.gcc.gnu.org/bugzilla/>
2012-09-17 17:54 ` [Bug c++/29234] Call to operator() of temporary object wrongly parsed poletti.marco at gmail dot com
2012-09-17 17:57 ` poletti.marco at gmail dot com
@ 2012-09-17 17:59 ` poletti.marco at gmail dot com
2013-10-30 14:42 ` paolo.carlini at oracle dot com
` (4 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: poletti.marco at gmail dot com @ 2012-09-17 17:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
--- Comment #6 from poletti.marco at gmail dot com 2012-09-17 17:57:58 UTC ---
Still an issue with GCC 4.7.1.
Clang does not have this issue.
Yet another example:
struct C {
void operator[](C) {
}
};
void f() {
C x;
(C()[x]);
}
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
[not found] <bug-29234-4@http.gcc.gnu.org/bugzilla/>
` (2 preceding siblings ...)
2012-09-17 17:59 ` poletti.marco at gmail dot com
@ 2013-10-30 14:42 ` paolo.carlini at oracle dot com
2013-10-30 17:58 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-10-30 14:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC|gcc-bugs at gcc dot gnu.org |
Assignee|unassigned at gcc dot gnu.org |paolo.carlini at oracle dot com
Known to fail| |
--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Looking into it.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
[not found] <bug-29234-4@http.gcc.gnu.org/bugzilla/>
` (3 preceding siblings ...)
2013-10-30 14:42 ` paolo.carlini at oracle dot com
@ 2013-10-30 17:58 ` paolo.carlini at oracle dot com
2013-11-02 9:34 ` paolo at gcc dot gnu.org
` (2 subsequent siblings)
7 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-10-30 17:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Tentative patch here: http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02536.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
[not found] <bug-29234-4@http.gcc.gnu.org/bugzilla/>
` (4 preceding siblings ...)
2013-10-30 17:58 ` paolo.carlini at oracle dot com
@ 2013-11-02 9:34 ` paolo at gcc dot gnu.org
2013-11-02 9:36 ` paolo.carlini at oracle dot com
2014-06-26 19:24 ` paolo.carlini at oracle dot com
7 siblings, 0 replies; 11+ messages in thread
From: paolo at gcc dot gnu.org @ 2013-11-02 9:34 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
--- Comment #9 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Sat Nov 2 09:34:13 2013
New Revision: 204312
URL: http://gcc.gnu.org/viewcvs?rev=204312&root=gcc&view=rev
Log:
/cp
2013-11-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/29234
PR c++/56037
* parser.c (cp_parser_cast_expression): If we aren't looking at
a cast-expression don't call cp_parser_type_id.
(cp_parser_postfix_expression): Likewise for compound-literal.
(cp_parser_tokens_start_cast_expression): Adjust.
/testsuite
2013-11-02 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/29234
PR c++/56037
* g++.dg/parse/pr29234.C: New.
* g++.dg/parse/pr56037.C: Likewise.
Added:
trunk/gcc/testsuite/g++.dg/parse/pr29234.C
trunk/gcc/testsuite/g++.dg/parse/pr56037.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/parser.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
[not found] <bug-29234-4@http.gcc.gnu.org/bugzilla/>
` (5 preceding siblings ...)
2013-11-02 9:34 ` paolo at gcc dot gnu.org
@ 2013-11-02 9:36 ` paolo.carlini at oracle dot com
2014-06-26 19:24 ` paolo.carlini at oracle dot com
7 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-11-02 9:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |4.9.0
--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.9.0.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
[not found] <bug-29234-4@http.gcc.gnu.org/bugzilla/>
` (6 preceding siblings ...)
2013-11-02 9:36 ` paolo.carlini at oracle dot com
@ 2014-06-26 19:24 ` paolo.carlini at oracle dot com
7 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-26 19:24 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |niels at penneman dot org
--- Comment #11 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 55535 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
2006-09-26 10:40 [Bug c++/29234] New: Cannot put temporary member functor calls inside brackets lloyd dot reed at vistec-semi dot com
2006-10-10 3:51 ` [Bug c++/29234] Call to operator() of temporary object wrongly parsed bangerth at dealii dot org
2007-02-07 5:14 ` lidaobing at gmail dot com
@ 2009-11-13 21:07 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-11-13 21:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from pinskia at gcc dot gnu dot org 2009-11-13 21:07 -------
*** Bug 42034 has been marked as a duplicate of this bug. ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |sc09q4 at bullseye dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
2006-09-26 10:40 [Bug c++/29234] New: Cannot put temporary member functor calls inside brackets lloyd dot reed at vistec-semi dot com
2006-10-10 3:51 ` [Bug c++/29234] Call to operator() of temporary object wrongly parsed bangerth at dealii dot org
@ 2007-02-07 5:14 ` lidaobing at gmail dot com
2009-11-13 21:07 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 11+ messages in thread
From: lidaobing at gmail dot com @ 2007-02-07 5:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from lidaobing at gmail dot com 2007-02-07 05:13 -------
*** Bug 30725 has been marked as a duplicate of this bug. ***
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/29234] Call to operator() of temporary object wrongly parsed
2006-09-26 10:40 [Bug c++/29234] New: Cannot put temporary member functor calls inside brackets lloyd dot reed at vistec-semi dot com
@ 2006-10-10 3:51 ` bangerth at dealii dot org
2007-02-07 5:14 ` lidaobing at gmail dot com
2009-11-13 21:07 ` pinskia at gcc dot gnu dot org
2 siblings, 0 replies; 11+ messages in thread
From: bangerth at dealii dot org @ 2006-10-10 3:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from bangerth at dealii dot org 2006-10-10 03:51 -------
Confirmed:
------------------
struct S { void operator () (); };
void foo ()
{
( S()() );
}
------------------
g/x> /home/bangerth/bin/gcc-4.2-pre/bin/c++ -c x.cc
x.cc: In function ‘void foo()’:
x.cc:5: error: ‘type name’ declared as function returning a
function
x.cc:5: error: ‘type name’ declared as function returning a
function
The error message also isn't particularly enlightening, and is duplicated
on top of that.
I think what is happening is that we parse the expression as the beginning
of a C-style cast to type
S (*) ()
but when we don't find an argument for the cast, we should backtrack.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bangerth at dealii dot org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Keywords| |rejects-valid
Priority|P3 |P2
Last reconfirmed|0000-00-00 00:00:00 |2006-10-10 03:51:44
date| |
Summary|Cannot put temporary member |Call to operator() of
|functor calls inside |temporary object wrongly
|brackets |parsed
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29234
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2014-06-26 19:24 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <bug-29234-4@http.gcc.gnu.org/bugzilla/>
2012-09-17 17:54 ` [Bug c++/29234] Call to operator() of temporary object wrongly parsed poletti.marco at gmail dot com
2012-09-17 17:57 ` poletti.marco at gmail dot com
2012-09-17 17:59 ` poletti.marco at gmail dot com
2013-10-30 14:42 ` paolo.carlini at oracle dot com
2013-10-30 17:58 ` paolo.carlini at oracle dot com
2013-11-02 9:34 ` paolo at gcc dot gnu.org
2013-11-02 9:36 ` paolo.carlini at oracle dot com
2014-06-26 19:24 ` paolo.carlini at oracle dot com
2006-09-26 10:40 [Bug c++/29234] New: Cannot put temporary member functor calls inside brackets lloyd dot reed at vistec-semi dot com
2006-10-10 3:51 ` [Bug c++/29234] Call to operator() of temporary object wrongly parsed bangerth at dealii dot org
2007-02-07 5:14 ` lidaobing at gmail dot com
2009-11-13 21:07 ` pinskia at gcc dot gnu 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).