constexpr member function cannot use the class type it belongs as parameter type or return type. gcc issues errors for the following code. struct X { constexpr X() { } // error : invalid parameter type and return type. // same for static and non-static member function constexpr X f( X x ) { return x ; } } ; I think this is a well-formed code. Base class name can be used. Also gcc issues errors for the following code which I think it's caused by the same problem. struct X { constexpr X() { } // declaration constexpr X f( X x ) ; } ; // definition // error : redeclaration differs constexpr X X::f( X x ) { return x ; } There is no difference in the redeclaration. So this error is wrong.
Adding Jason in CC.
Author: jason Date: Tue Mar 29 13:27:25 2011 New Revision: 171661 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171661 Log: PR c++/48296 * decl.c (cp_finish_decl): Defer validation of constexpr member functions. * class.c (finalize_literal_type_property): Validate them here. * semantics.c (is_valid_constexpr_fn): Don't check completeness. Added: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-memfn1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/class.c trunk/gcc/cp/decl.c trunk/gcc/cp/semantics.c trunk/gcc/testsuite/ChangeLog
Author: jason Date: Tue Mar 29 14:26:33 2011 New Revision: 171675 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171675 Log: PR c++/48296 * decl.c (cp_finish_decl): Defer validation of constexpr member functions. * class.c (finalize_literal_type_property): Validate them here. * semantics.c (is_valid_constexpr_fn): Don't check completeness. Added: branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-memfn1.C Modified: branches/gcc-4_6-branch/gcc/cp/ChangeLog branches/gcc-4_6-branch/gcc/cp/class.c branches/gcc-4_6-branch/gcc/cp/decl.c branches/gcc-4_6-branch/gcc/cp/semantics.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog
Fixed for 4.6.1.
Author: jb Date: Sat Jun 18 07:53:09 2011 New Revision: 175166 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175166 Log: PR 49296 List directed read of string ending in EOF. libgfortran ChangeLog entry: 2011-06-18 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/49296 * io/list_read.c (read_character): Accept EOF as a separator when reading string. testsuite ChangeLog entry: 2011-06-18 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/48296 * gfortran.dg/read_list_eof_1.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/read_list_eof_1.f90 Modified: trunk/gcc/testsuite/ChangeLog trunk/libgfortran/ChangeLog trunk/libgfortran/io/list_read.c
Author: jb Date: Sun Jul 3 15:54:02 2011 New Revision: 175787 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175787 Log: PR 48296 Accept EOF as separator when reading string with list format. 2011-07-03 Janne Blomqvist <jb@gcc.gnu.org> Backport from mainline: PR libfortran/49296 * io/list_read.c (read_character): Accept EOF as a separator when reading string. 2011-07-03 Janne Blomqvist <jb@gcc.gnu.org> Backport from mainline: PR libfortran/48296 * gfortran.dg/read_list_eof_1.f90: New test. Added: branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/read_list_eof_1.f90 Modified: branches/gcc-4_6-branch/gcc/testsuite/ChangeLog branches/gcc-4_6-branch/libgfortran/ChangeLog branches/gcc-4_6-branch/libgfortran/io/list_read.c