public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/48296] New: constexpr member function cannot use the class type it belongs as parameter type or return type
@ 2011-03-27 9:33 boostcpp at gmail dot com
2011-03-28 16:21 ` [Bug c++/48296] [C++0x] " paolo.carlini at oracle dot com
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: boostcpp at gmail dot com @ 2011-03-27 9:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48296
Summary: constexpr member function cannot use the class type it
belongs as parameter type or return type
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: boostcpp@gmail.com
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.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/48296] [C++0x] constexpr member function cannot use the class type it belongs as parameter type or return type
2011-03-27 9:33 [Bug c++/48296] New: constexpr member function cannot use the class type it belongs as parameter type or return type boostcpp at gmail dot com
@ 2011-03-28 16:21 ` paolo.carlini at oracle dot com
2011-03-29 0:01 ` jason at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-03-28 16:21 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48296
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
Summary|constexpr member function |[C++0x] constexpr member
|cannot use the class type |function cannot use the
|it belongs as parameter |class type it belongs as
|type or return type |parameter type or return
| |type
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-03-28 16:11:00 UTC ---
Adding Jason in CC.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/48296] [C++0x] constexpr member function cannot use the class type it belongs as parameter type or return type
2011-03-27 9:33 [Bug c++/48296] New: constexpr member function cannot use the class type it belongs as parameter type or return type boostcpp at gmail dot com
2011-03-28 16:21 ` [Bug c++/48296] [C++0x] " paolo.carlini at oracle dot com
@ 2011-03-29 0:01 ` jason at gcc dot gnu.org
2011-03-29 13:47 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-29 0:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48296
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011.03.28 23:51:40
AssignedTo|unassigned at gcc dot |jason at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/48296] [C++0x] constexpr member function cannot use the class type it belongs as parameter type or return type
2011-03-27 9:33 [Bug c++/48296] New: constexpr member function cannot use the class type it belongs as parameter type or return type boostcpp at gmail dot com
2011-03-28 16:21 ` [Bug c++/48296] [C++0x] " paolo.carlini at oracle dot com
2011-03-29 0:01 ` jason at gcc dot gnu.org
@ 2011-03-29 13:47 ` jason at gcc dot gnu.org
2011-03-29 14:30 ` jason at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-29 13:47 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48296
--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-29 13:27:31 UTC ---
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/48296] [C++0x] constexpr member function cannot use the class type it belongs as parameter type or return type
2011-03-27 9:33 [Bug c++/48296] New: constexpr member function cannot use the class type it belongs as parameter type or return type boostcpp at gmail dot com
` (2 preceding siblings ...)
2011-03-29 13:47 ` jason at gcc dot gnu.org
@ 2011-03-29 14:30 ` jason at gcc dot gnu.org
2011-03-29 14:33 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-29 14:30 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48296
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-29 14:26:43 UTC ---
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/48296] [C++0x] constexpr member function cannot use the class type it belongs as parameter type or return type
2011-03-27 9:33 [Bug c++/48296] New: constexpr member function cannot use the class type it belongs as parameter type or return type boostcpp at gmail dot com
` (3 preceding siblings ...)
2011-03-29 14:30 ` jason at gcc dot gnu.org
@ 2011-03-29 14:33 ` jason at gcc dot gnu.org
2011-06-18 7:54 ` jb at gcc dot gnu.org
2011-07-03 15:54 ` jb at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2011-03-29 14:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48296
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.6.1
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> 2011-03-29 14:29:24 UTC ---
Fixed for 4.6.1.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/48296] [C++0x] constexpr member function cannot use the class type it belongs as parameter type or return type
2011-03-27 9:33 [Bug c++/48296] New: constexpr member function cannot use the class type it belongs as parameter type or return type boostcpp at gmail dot com
` (4 preceding siblings ...)
2011-03-29 14:33 ` jason at gcc dot gnu.org
@ 2011-06-18 7:54 ` jb at gcc dot gnu.org
2011-07-03 15:54 ` jb at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jb at gcc dot gnu.org @ 2011-06-18 7:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48296
--- Comment #5 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-06-18 07:53:12 UTC ---
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
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/48296] [C++0x] constexpr member function cannot use the class type it belongs as parameter type or return type
2011-03-27 9:33 [Bug c++/48296] New: constexpr member function cannot use the class type it belongs as parameter type or return type boostcpp at gmail dot com
` (5 preceding siblings ...)
2011-06-18 7:54 ` jb at gcc dot gnu.org
@ 2011-07-03 15:54 ` jb at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jb at gcc dot gnu.org @ 2011-07-03 15:54 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48296
--- Comment #6 from Janne Blomqvist <jb at gcc dot gnu.org> 2011-07-03 15:54:05 UTC ---
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
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2011-07-03 15:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-27 9:33 [Bug c++/48296] New: constexpr member function cannot use the class type it belongs as parameter type or return type boostcpp at gmail dot com
2011-03-28 16:21 ` [Bug c++/48296] [C++0x] " paolo.carlini at oracle dot com
2011-03-29 0:01 ` jason at gcc dot gnu.org
2011-03-29 13:47 ` jason at gcc dot gnu.org
2011-03-29 14:30 ` jason at gcc dot gnu.org
2011-03-29 14:33 ` jason at gcc dot gnu.org
2011-06-18 7:54 ` jb at gcc dot gnu.org
2011-07-03 15:54 ` jb at gcc dot gnu.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).