Created attachment 25842 [details] Outputs by -v option and preprocessed source. An abstract class shall not be used as a function return type. However, GCC 4.7-20111112 accepts the following code. /////////////////////// template<typename T> struct S{}; struct A { virtual void f() = 0; }; int main() { S<A(int)> s; } ///////////////////////
On it.
GCC 4.7.0 is being released, adjusting target milestone.
Author: paolo Date: Mon May 21 15:12:13 2012 New Revision: 187720 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=187720 Log: /cp 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51184 * decl.c (grokdeclarator): Diagnose functions returning abstract class types as TYPENAME. * cp-tree.h (ABSTRACT_CLASS_TYPE_P): Add. * except.c (is_admissible_throw_operand_or_catch_parameter): Use it. * pt.c (tsubst): Likewise. * semantics.c (trait_expr_value): Likewise. /testsuite 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51184 * g++.dg/other/abstract4.C: New- /cp 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com> PR c++/40821 * parser.c (cp_parser_attributes_opt): Enforce error checking of unbalanced parentheses in the presence of tentative parsing. /testsuite 2012-05-21 Paolo Carlini <paolo.carlini@oracle.com> PR c++/40821 * g++.dg/ext/attrib46.C: New. Added: trunk/gcc/testsuite/g++.dg/ext/attrib46.C trunk/gcc/testsuite/g++.dg/other/abstract4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cp-tree.h trunk/gcc/cp/decl.c trunk/gcc/cp/except.c trunk/gcc/cp/parser.c trunk/gcc/cp/pt.c trunk/gcc/cp/semantics.c trunk/gcc/testsuite/ChangeLog
Done.