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] New: Cannot put temporary member functor calls inside brackets @ 2006-09-26 10:40 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 ` (2 more replies) 0 siblings, 3 replies; 11+ messages in thread From: lloyd dot reed at vistec-semi dot com @ 2006-09-26 10:40 UTC (permalink / raw) To: gcc-bugs Putting calls of temporary member functors in brackets causes an error, "error: `type name' declared as function returning a function". The following code: struct S { struct Member_functor { void operator () () { } }; }; int main( int argc, char* argv[] ) { S::Member_functor()(); // OK ( S::Member_functor()() ); // error: `type name' declared as function returning a function return 0; } produces this error using Cygwin gcc 3.4.4 on a WindowsXP Pro sp2 PC: J:\>g++ -o gcc_test2.exe gcc_test2.cpp -Wall -save-temps -v Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --enable-languages=c,ada,c++,d,f77,java,objc --enable-nls --without-included-gettext --enable-version-specific-runtime-libs --without-x --enable-libgcj --disable-java-awt --with-system-zlib --enable-interpreter --disable-libgcj-debug --enable-threads=posix --enable-java-gc=boehm --disable-win32-registry --enable-sjlj-exceptions --enable-hash-synchronization --enable-libstdcxx-debug : (reconfigured) Thread model: posix gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125) /usr/lib/gcc/i686-pc-cygwin/3.4.4/cc1plus.exe -E -quiet -v -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -idirafter /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api -idirafter /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/lib/../../include/w32api gcc_test2.cpp -mtune=pentiumpro -Wall -o gcc_test2.ii ignoring nonexistent directory "/usr/local/include" ignoring nonexistent directory "/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/include" ignoring duplicate directory "/usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../i686-pc-cygwin/lib/../../include/w32api" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++ /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/i686-pc-cygwin /usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/backward /usr/lib/gcc/i686-pc-cygwin/3.4.4/include /usr/include /usr/lib/gcc/i686-pc-cygwin/3.4.4/../../../../include/w32api End of search list. /usr/lib/gcc/i686-pc-cygwin/3.4.4/cc1plus.exe -fpreprocessed gcc_test2.ii -quiet -dumpbase gcc_test2.cpp -mtune=pentiumpro -auxbase gcc_test2 -Wall -version -o gcc_test2.s GNU C++ version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125) (i686-pc-cygwin) compiled by GNU C version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 gcc_test2.cpp: In function `int main(int, char**)': gcc_test2.cpp:14: error: `type name' declared as function returning a function gcc_test2.cpp:14: error: `type name' declared as function returning a function The same applies to functors returning values. The contents of the preprocessed file is given below: # 1 "gcc_test2.cpp" # 1 "<built-in>" # 1 "<command line>" # 1 "gcc_test2.cpp" struct S { struct Member_functor { void operator () () { } }; }; int main( int argc, char* argv[] ) { S::Member_functor()(); ( S::Member_functor()() ); return 0; } -- Summary: Cannot put temporary member functor calls inside brackets Product: gcc Version: 3.4.4 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: lloyd dot reed at vistec-semi dot com GCC host triplet: i686-pc-cygwin 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
* [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 ` [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
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).