diff -Nrcpad gcc-4.2.1/gcc/cp/ChangeLog gcc-4.2.2/gcc/cp/ChangeLog *** gcc-4.2.1/gcc/cp/ChangeLog Thu Jul 19 14:29:21 2007 --- gcc-4.2.2/gcc/cp/ChangeLog Sun Oct 7 21:19:52 2007 *************** *** 1,3 **** --- 1,150 ---- + 2007-10-07 Release Manager + + * GCC 4.2.2 released. + + 2007-09-20 Paolo Carlini + + PR c++/33459 + * init.c (build_zero_init): If, recursively, build_zero_init + returns a NULL_TREE, do not append it to the VEC of constructors. + + 2007-09-13 Jason Merrill + + PR c++/15097 + * init.c (build_delete): Use build_headof to get the address of the + complete object if we aren't using the deleting destructor. + * rtti.c (build_headof): No longer static. + * cp-tree.h: Declare it. + + 2007-09-11 Jason Merrill + + PR c++/31419 + * call.c (reference_binding): Don't look for user-defined conversions + to the same type. + + PR c++/15745 + * except.c (prepare_eh_type): Use type_decays_to. + + * except.c (initialize_handler_parm): Use + fold_build_cleanup_point_expr. + + PR c++/31411 + * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside + the MUST_NOT_THROW_EXPR. + + 2007-09-08 Jason Merrill + + PR c++/33342 + * pt.c (most_specialized_class): Set processing_template_decl + while tsubsting partial spec args. + + 2007-09-06 Jason Merrill + + * decl2.c (get_guard): Copy visibility from the guarded variable. + + 2007-09-06 Paolo Carlini + + PR c++/32674 + * decl.c (cp_finish_decl): When processing_template_decl, + deal correctly with init as TREE_LIST. + + 2007-09-05 Paolo Carlini + + PR c++/33210 + * cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with + BOUND_TEMPLATE_TEMPLATE_PARM. + + 2007-09-04 Jason Merrill + + PR c++/14032 + * pt.c (most_specialized_class): Substitute outer template + arguments into the arguments of a member template partial + specialization. + (strip_innermost_template_args): New fn. + + 2007-08-31 Paolo Carlini + + PR c++/32113 + * search.c (lookup_member): Check the name argument for + error_mark_node. + + 2007-08-29 Nick Clifton + + * typeck.c: Change copyright header to refer to version 3 of the + GNU General Public License and to point readers at the COPYING3 + file and the FSF's license web page. + * optimize.c, lang-specs.h, init.c, class.c, repo.c, decl.c, + config-lang.in, cp-tree.def, call.c, decl.h, ptree.c, + Make-lang.in, method.c, rtti.c, cp-objcp-common.c, g++spec.c, + cp-objcp-common.h, except.c, error.c, operators.def, cvt.c, + tree.c, mangle.c, cp-tree.h, dump.c, search.c, friend.c, expr.c, + cp-gimplify.c, cxx-pretty-print.c, cp-lang.c, typeck2.c, pt.c, + cxx-pretty-print.h, semantics.c, name-lookup.c, lex.c, decl2.c, + name-lookup.h, parser.c: Likewise. + + 2007-08-24 Jakub Jelinek + + PR c++/31941 + * error.c (resolve_virtual_fun_from_obj_type_ref): Handle + TARGET_VTABLE_USES_DESCRIPTORS targets properly. + + PR c++/32898 + * name-lookup.c (set_decl_namespace): lookup_qualified_name failure + is error_mark_node rather than NULL_TREE. + * pt.c (check_explicit_specialization): Likewise. + + 2007-08-22 Jason Merrill + + PR c++/29365 + * pt.c (outermost_tinst_level): New function. + * lex.c (in_main_input_context): New function. + * cp-tree.h: Declare it. + * decl2.c (constrain_class_visibility): Use it to avoid warning + about uses of the anonymous namespace in the main input file. + + 2007-08-20 Jakub Jelinek + + PR c++/32992 + * typeck.c (check_return_expr): Don't NRV optimize vars in + anonymous unions. + * decl.c (finish_function): Comment fix. + + 2007-08-18 Paolo Carlini + + PR c++/32112 + * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE. + * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise. + + 2007-08-10 Paolo Carlini + + PR c++/17763 + * error.c (dump_expr): Consistently use the *_cxx_* + variants of the pretty-print functions. + + 2007-07-30 Paolo Carlini + + PR c++/32108 + * semantics.c (finish_label_stmt): Reject the __label__ + extension outside function scopes. + + 2007-07-28 Simon Martin + Mark Mitchell + + PR c++/30917 + * name-lookup.c (lookup_name_real): Non namespace-scope bindings can be + hidden due to friend declarations in local classes. + + 2007-07-27 Mark Mitchell + + PR c++/32346 + * call.c (convert_for_arg_passing): Only widen bitfields to their + declared types if necessary. + + 2007-07-24 Paolo Carlini + + PR c++/30535 + * pt.c (unify): Never pass error_mark_node to template_decl_level. + 2007-07-19 Release Manager * GCC 4.2.1 released. diff -Nrcpad gcc-4.2.1/gcc/cp/Make-lang.in gcc-4.2.2/gcc/cp/Make-lang.in *** gcc-4.2.1/gcc/cp/Make-lang.in Tue Mar 13 18:41:53 2007 --- gcc-4.2.2/gcc/cp/Make-lang.in Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** # Top level -*- makefile -*- fragment for GNU C++. # Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ! # 2005 # Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by ! #the Free Software Foundation; either version 2, or (at your option) #any later version. #GCC is distributed in the hope that it will be useful, --- 1,13 ---- # Top level -*- makefile -*- fragment for GNU C++. # Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ! # 2005, 2007 # Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by ! #the Free Software Foundation; either version 3, or (at your option) #any later version. #GCC is distributed in the hope that it will be useful, *************** *** 15,24 **** #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. ! #You should have received a copy of the GNU General Public License ! #along with GCC; see the file COPYING. If not, write to ! #the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! #Boston, MA 02110-1301, USA. # This file provides the language dependent support in the main Makefile. # Each language makefile fragment must provide the following targets: --- 15,23 ---- #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. ! # You should have received a copy of the GNU General Public License ! # along with GCC; see the file COPYING3. If not see ! # . # This file provides the language dependent support in the main Makefile. # Each language makefile fragment must provide the following targets: diff -Nrcpad gcc-4.2.1/gcc/cp/call.c gcc-4.2.2/gcc/cp/call.c *** gcc-4.2.1/gcc/cp/call.c Sat Jul 7 02:02:37 2007 --- gcc-4.2.2/gcc/cp/call.c Tue Sep 11 15:40:51 2007 *************** *** 1,6 **** /* Functions related to invoking methods and overloaded functions. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) and modified by Brendan Kehoe (brendan@cygnus.com). --- 1,7 ---- /* Functions related to invoking methods and overloaded functions. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 ! Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) and modified by Brendan Kehoe (brendan@cygnus.com). *************** This file is part of GCC. *** 8,14 **** GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 9,15 ---- GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 17,25 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* High-level class interface. */ --- 18,25 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* High-level class interface. */ *************** reference_binding (tree rto, tree rfrom, *** 1153,1159 **** return conv; } ! else if (CLASS_TYPE_P (from) && !(flags & LOOKUP_NO_CONVERSION)) { /* [dcl.init.ref] --- 1153,1164 ---- return conv; } ! /* [class.conv.fct] A conversion function is never used to convert a ! (possibly cv-qualified) object to the (possibly cv-qualified) same ! object type (or a reference to it), to a (possibly cv-qualified) base ! class of that type (or a reference to it).... */ ! else if (CLASS_TYPE_P (from) && !related_p ! && !(flags & LOOKUP_NO_CONVERSION)) { /* [dcl.init.ref] *************** type_passed_as (tree type) *** 4674,4680 **** tree convert_for_arg_passing (tree type, tree val) { ! val = convert_bitfield_to_declared_type (val); if (val == error_mark_node) ; /* Pass classes with copy ctors by invisible reference. */ --- 4679,4705 ---- tree convert_for_arg_passing (tree type, tree val) { ! tree bitfield_type; ! ! /* If VAL is a bitfield, then -- since it has already been converted ! to TYPE -- it cannot have a precision greater than TYPE. ! ! If it has a smaller precision, we must widen it here. For ! example, passing "int f:3;" to a function expecting an "int" will ! not result in any conversion before this point. ! ! If the precision is the same we must not risk widening. For ! example, the COMPONENT_REF for a 32-bit "long long" bitfield will ! often have type "int", even though the C++ type for the field is ! "long long". If the value is being passed to a function ! expecting an "int", then no conversions will be required. But, ! if we call convert_bitfield_to_declared_type, the bitfield will ! be converted to "long long". */ ! bitfield_type = is_bitfield_expr_with_lowered_type (val); ! if (bitfield_type ! && TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type)) ! val = convert_to_integer (TYPE_MAIN_VARIANT (bitfield_type), val); ! if (val == error_mark_node) ; /* Pass classes with copy ctors by invisible reference. */ diff -Nrcpad gcc-4.2.1/gcc/cp/class.c gcc-4.2.2/gcc/cp/class.c *** gcc-4.2.1/gcc/cp/class.c Tue Jul 3 15:26:59 2007 --- gcc-4.2.2/gcc/cp/class.c Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** /* Functions related to building classes and their related objects. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,14 ---- /* Functions related to building classes and their related objects. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 ! Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* High-level class interface. */ --- 17,24 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* High-level class interface. */ diff -Nrcpad gcc-4.2.1/gcc/cp/config-lang.in gcc-4.2.2/gcc/cp/config-lang.in *** gcc-4.2.1/gcc/cp/config-lang.in Sat Jul 9 15:45:09 2005 --- gcc-4.2.2/gcc/cp/config-lang.in Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** # Top level configure fragment for GNU C++. ! # Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002 # Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by ! #the Free Software Foundation; either version 2, or (at your option) #any later version. #GCC is distributed in the hope that it will be useful, --- 1,12 ---- # Top level configure fragment for GNU C++. ! # Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2007 # Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by ! #the Free Software Foundation; either version 3, or (at your option) #any later version. #GCC is distributed in the hope that it will be useful, *************** *** 14,23 **** #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. ! #You should have received a copy of the GNU General Public License ! #along with GCC; see the file COPYING. If not, write to ! #the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! #Boston, MA 02110-1301, USA. # Configure looks for the existence of this file to auto-config each language. # We define several parameters used by configure: --- 14,22 ---- #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. ! # You should have received a copy of the GNU General Public License ! # along with GCC; see the file COPYING3. If not see ! # . # Configure looks for the existence of this file to auto-config each language. # We define several parameters used by configure: diff -Nrcpad gcc-4.2.1/gcc/cp/cp-gimplify.c gcc-4.2.2/gcc/cp/cp-gimplify.c *** gcc-4.2.1/gcc/cp/cp-gimplify.c Wed Feb 7 13:37:29 2007 --- gcc-4.2.2/gcc/cp/cp-gimplify.c Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** /* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c. ! Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Jason Merrill This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY --- 1,14 ---- /* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c. ! Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 ! Free Software Foundation, Inc. Contributed by Jason Merrill This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY *************** FITNESS FOR A PARTICULAR PURPOSE. See t *** 16,24 **** for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to the Free ! Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ! 02110-1301, USA. */ #include "config.h" #include "system.h" --- 17,24 ---- for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" diff -Nrcpad gcc-4.2.1/gcc/cp/cp-lang.c gcc-4.2.2/gcc/cp/cp-lang.c *** gcc-4.2.1/gcc/cp/cp-lang.c Tue Jun 6 11:44:09 2006 --- gcc-4.2.2/gcc/cp/cp-lang.c Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** /* Language-dependent hooks for C++. ! Copyright 2001, 2002, 2004 Free Software Foundation, Inc. Contributed by Alexandre Oliva This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,12 ---- /* Language-dependent hooks for C++. ! Copyright 2001, 2002, 2004, 2007 Free Software Foundation, Inc. Contributed by Alexandre Oliva This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 15,23 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" --- 15,22 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" diff -Nrcpad gcc-4.2.1/gcc/cp/cp-objcp-common.c gcc-4.2.2/gcc/cp/cp-objcp-common.c *** gcc-4.2.1/gcc/cp/cp-objcp-common.c Mon Sep 11 00:40:15 2006 --- gcc-4.2.2/gcc/cp/cp-objcp-common.c Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** /* Some code common to C++ and ObjC++ front ends. ! Copyright (C) 2004 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY --- 1,12 ---- /* Some code common to C++ and ObjC++ front ends. ! Copyright (C) 2004, 2007 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY *************** FITNESS FOR A PARTICULAR PURPOSE. See t *** 15,23 **** for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to the Free ! Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ! 02110-1301, USA. */ #include "config.h" #include "system.h" --- 15,22 ---- for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" diff -Nrcpad gcc-4.2.1/gcc/cp/cp-objcp-common.h gcc-4.2.2/gcc/cp/cp-objcp-common.h *** gcc-4.2.1/gcc/cp/cp-objcp-common.h Mon Sep 11 00:40:15 2006 --- gcc-4.2.2/gcc/cp/cp-objcp-common.h Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** /* Language hooks common to C++ and ObjC++ front ends. ! Copyright (C) 2004, 2005 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY --- 1,12 ---- /* Language hooks common to C++ and ObjC++ front ends. ! Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY *************** FITNESS FOR A PARTICULAR PURPOSE. See t *** 15,23 **** for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to the Free ! Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ! 02110-1301, USA. */ #ifndef GCC_CP_OBJCP_COMMON #define GCC_CP_OBJCP_COMMON --- 15,22 ---- for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #ifndef GCC_CP_OBJCP_COMMON #define GCC_CP_OBJCP_COMMON diff -Nrcpad gcc-4.2.1/gcc/cp/cp-tree.def gcc-4.2.2/gcc/cp/cp-tree.def *** gcc-4.2.1/gcc/cp/cp-tree.def Wed Jun 14 19:07:12 2006 --- gcc-4.2.2/gcc/cp/cp-tree.def Fri Aug 31 08:27:50 2007 *************** *** 2,15 **** additional tree codes used in the GNU C++ compiler (see tree.def for the standard codes). Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004, 2005, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 2,16 ---- additional tree codes used in the GNU C++ compiler (see tree.def for the standard codes). Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004, 2005, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 ! Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 18,26 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* An OFFSET_REF is used in two situations: --- 19,26 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* An OFFSET_REF is used in two situations: diff -Nrcpad gcc-4.2.1/gcc/cp/cp-tree.h gcc-4.2.2/gcc/cp/cp-tree.h *** gcc-4.2.1/gcc/cp/cp-tree.h Sat Jul 7 02:02:37 2007 --- gcc-4.2.2/gcc/cp/cp-tree.h Thu Sep 13 13:42:11 2007 *************** *** 1,13 **** /* Definitions for C++ parsing and type checking. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,14 ---- /* Definitions for C++ parsing and type checking. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 ! Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #ifndef GCC_CP_TREE_H #define GCC_CP_TREE_H --- 17,24 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #ifndef GCC_CP_TREE_H #define GCC_CP_TREE_H *************** extern void yyerror (const char *); *** 4079,4084 **** --- 4079,4085 ---- extern void yyhook (int); extern bool cxx_init (void); extern void cxx_finish (void); + extern bool in_main_input_context (void); /* in method.c */ extern void init_method (void); *************** extern tree build_non_dependent_args (t *** 4161,4166 **** --- 4162,4168 ---- extern bool reregister_specialization (tree, tree, tree); extern tree fold_non_dependent_expr (tree); extern bool explicit_class_specialization_p (tree); + extern tree outermost_tinst_level (void); /* in repo.c */ extern void init_repo (void); *************** extern void init_rtti_processing (void) *** 4176,4181 **** --- 4178,4184 ---- extern tree build_typeid (tree); extern tree get_tinfo_decl (tree); extern tree get_typeid (tree); + extern tree build_headof (tree); extern tree build_dynamic_cast (tree, tree); extern void emit_support_tinfos (void); extern bool emit_tinfo_decl (tree); diff -Nrcpad gcc-4.2.1/gcc/cp/cvt.c gcc-4.2.2/gcc/cp/cvt.c *** gcc-4.2.1/gcc/cp/cvt.c Wed Mar 7 20:24:37 2007 --- gcc-4.2.2/gcc/cp/cvt.c Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** /* Language-level data type conversion for GNU C++. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,14 ---- /* Language-level data type conversion for GNU C++. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 ! Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* This file contains the functions for converting C++ expressions --- 17,24 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* This file contains the functions for converting C++ expressions diff -Nrcpad gcc-4.2.1/gcc/cp/cxx-pretty-print.c gcc-4.2.2/gcc/cp/cxx-pretty-print.c *** gcc-4.2.1/gcc/cp/cxx-pretty-print.c Tue Jun 6 11:44:09 2006 --- gcc-4.2.2/gcc/cp/cxx-pretty-print.c Wed Sep 5 10:40:29 2007 *************** *** 1,12 **** /* Implementation of subroutines for the GNU C++ pretty-printer. ! Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY --- 1,12 ---- /* Implementation of subroutines for the GNU C++ pretty-printer. ! Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY *************** FITNESS FOR A PARTICULAR PURPOSE. See t *** 15,23 **** for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to the Free ! Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ! 02110-1301, USA. */ #include "config.h" #include "system.h" --- 15,22 ---- for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" *************** pp_cxx_unqualified_id (cxx_pretty_printe *** 204,209 **** --- 203,220 ---- pp_cxx_unqualified_id (pp, TEMPLATE_PARM_DECL (t)); break; + case UNBOUND_CLASS_TEMPLATE: + pp_cxx_unqualified_id (pp, TYPE_NAME (t)); + break; + + case BOUND_TEMPLATE_TEMPLATE_PARM: + pp_cxx_cv_qualifier_seq (pp, t); + pp_cxx_unqualified_id (pp, TYPE_IDENTIFIER (t)); + pp_cxx_begin_template_argument_list (pp); + pp_cxx_template_argument_list (pp, TYPE_TI_ARGS (t)); + pp_cxx_end_template_argument_list (pp); + break; + default: pp_unsupported_tree (pp, t); break; diff -Nrcpad gcc-4.2.1/gcc/cp/cxx-pretty-print.h gcc-4.2.2/gcc/cp/cxx-pretty-print.h *** gcc-4.2.1/gcc/cp/cxx-pretty-print.h Thu Jul 21 10:33:31 2005 --- gcc-4.2.2/gcc/cp/cxx-pretty-print.h Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** /* Interface for the GNU C++ pretty-printer. ! Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY --- 1,12 ---- /* Interface for the GNU C++ pretty-printer. ! Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free ! Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY *************** FITNESS FOR A PARTICULAR PURPOSE. See t *** 15,23 **** for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to the Free ! Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ! 02110-1301, USA. */ #ifndef GCC_CXX_PRETTY_PRINT_H #define GCC_CXX_PRETTY_PRINT_H --- 15,22 ---- for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #ifndef GCC_CXX_PRETTY_PRINT_H #define GCC_CXX_PRETTY_PRINT_H diff -Nrcpad gcc-4.2.1/gcc/cp/decl.c gcc-4.2.2/gcc/cp/decl.c *** gcc-4.2.1/gcc/cp/decl.c Sat Jul 7 02:02:37 2007 --- gcc-4.2.2/gcc/cp/decl.c Thu Sep 6 19:19:15 2007 *************** *** 1,13 **** /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ! 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,13 ---- /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ! 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* Process declarations and symbol lookup for C++ front end. --- 16,23 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* Process declarations and symbol lookup for C++ front end. *************** cp_finish_decl (tree decl, tree init, bo *** 5215,5221 **** goto finish_end; } ! init = fold_non_dependent_expr (init); processing_template_decl = 0; } --- 5214,5234 ---- goto finish_end; } ! if (TREE_CODE (init) == TREE_LIST) ! { ! /* If the parenthesized-initializer form was used (e.g., ! "int A::i(X)"), then INIT will be a TREE_LIST of initializer ! arguments. (There is generally only one.) We convert them ! individually. */ ! tree list = init; ! for (; list; list = TREE_CHAIN (list)) ! { ! tree elt = TREE_VALUE (list); ! TREE_VALUE (list) = fold_non_dependent_expr (elt); ! } ! } ! else ! init = fold_non_dependent_expr (init); processing_template_decl = 0; } *************** finish_function (int flags) *** 11273,11279 **** gcc_assert (stmts_are_full_exprs_p ()); /* Set up the named return value optimization, if we can. Candidate ! variables are selected in check_return_value. */ if (current_function_return_value) { tree r = current_function_return_value; --- 11286,11292 ---- gcc_assert (stmts_are_full_exprs_p ()); /* Set up the named return value optimization, if we can. Candidate ! variables are selected in check_return_expr. */ if (current_function_return_value) { tree r = current_function_return_value; diff -Nrcpad gcc-4.2.1/gcc/cp/decl.h gcc-4.2.2/gcc/cp/decl.h *** gcc-4.2.1/gcc/cp/decl.h Sat Jun 25 00:59:41 2005 --- gcc-4.2.2/gcc/cp/decl.h Fri Aug 31 08:27:50 2007 *************** *** 1,11 **** /* Variables and structures for declaration processing. ! Copyright (C) 1993, 2000, 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,12 ---- /* Variables and structures for declaration processing. ! Copyright (C) 1993, 2000, 2002, 2004, 2005, 2007 ! Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 14,22 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* In grokdeclarator, distinguish syntactic contexts of declarators. */ enum decl_context --- 15,22 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* In grokdeclarator, distinguish syntactic contexts of declarators. */ enum decl_context diff -Nrcpad gcc-4.2.1/gcc/cp/decl2.c gcc-4.2.2/gcc/cp/decl2.c *** gcc-4.2.1/gcc/cp/decl2.c Tue Jun 19 00:40:30 2007 --- gcc-4.2.2/gcc/cp/decl2.c Fri Sep 7 03:57:35 2007 *************** *** 1,13 **** /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,13 ---- /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* Process declarations and symbol lookup for C++ front end. --- 16,23 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* Process declarations and symbol lookup for C++ front end. *************** constrain_class_visibility (tree type) *** 1860,1868 **** int subvis = type_visibility (ftype); if (subvis == VISIBILITY_ANON) ! warning (0, "\ %qT has a field %qD whose type uses the anonymous namespace", type, t); else if (IS_AGGR_TYPE (ftype) && vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) --- 1859,1870 ---- int subvis = type_visibility (ftype); if (subvis == VISIBILITY_ANON) ! { ! if (!in_main_input_context ()) ! warning (0, "\ %qT has a field %qD whose type uses the anonymous namespace", type, t); + } else if (IS_AGGR_TYPE (ftype) && vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) *************** constrain_class_visibility (tree type) *** 1877,1885 **** int subvis = type_visibility (TREE_TYPE (t)); if (subvis == VISIBILITY_ANON) ! warning (0, "\ %qT has a base %qT whose type uses the anonymous namespace", type, TREE_TYPE (t)); else if (vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) warning (OPT_Wattributes, "\ --- 1879,1890 ---- int subvis = type_visibility (TREE_TYPE (t)); if (subvis == VISIBILITY_ANON) ! { ! if (!in_main_input_context()) ! warning (0, "\ %qT has a base %qT whose type uses the anonymous namespace", type, TREE_TYPE (t)); + } else if (vis < VISIBILITY_HIDDEN && subvis >= VISIBILITY_HIDDEN) warning (OPT_Wattributes, "\ *************** get_guard (tree decl) *** 2219,2224 **** --- 2224,2231 ---- DECL_ONE_ONLY (guard) = DECL_ONE_ONLY (decl); if (TREE_PUBLIC (decl)) DECL_WEAK (guard) = DECL_WEAK (decl); + DECL_VISIBILITY (guard) = DECL_VISIBILITY (decl); + DECL_VISIBILITY_SPECIFIED (guard) = DECL_VISIBILITY_SPECIFIED (decl); DECL_ARTIFICIAL (guard) = 1; DECL_IGNORED_P (guard) = 1; diff -Nrcpad gcc-4.2.1/gcc/cp/dump.c gcc-4.2.2/gcc/cp/dump.c *** gcc-4.2.1/gcc/cp/dump.c Sun Jul 3 06:50:51 2005 --- gcc-4.2.2/gcc/cp/dump.c Fri Aug 31 08:27:50 2007 *************** *** 1,5 **** /* Tree-dumping functionality for intermediate representation. ! Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Written by Mark Mitchell --- 1,5 ---- /* Tree-dumping functionality for intermediate representation. ! Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Mark Mitchell *************** This file is part of GCC. *** 7,13 **** GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 7,13 ---- GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" --- 16,23 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" diff -Nrcpad gcc-4.2.1/gcc/cp/error.c gcc-4.2.2/gcc/cp/error.c *** gcc-4.2.1/gcc/cp/error.c Mon Dec 4 18:31:40 2006 --- gcc-4.2.2/gcc/cp/error.c Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** /* Call-backs for C++ error reporting. This code is non-reentrant. Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, ! 2003, 2004, 2005 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,12 ---- /* Call-backs for C++ error reporting. This code is non-reentrant. Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, ! 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 15,23 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" --- 15,22 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" *************** dump_decl (tree t, int flags) *** 901,906 **** --- 900,909 ---- pp_type_id (cxx_pp, t); break; + case UNBOUND_CLASS_TEMPLATE: + dump_type (t, flags); + break; + default: pp_unsupported_tree (cxx_pp, t); /* Fall through to error. */ *************** static tree *** 1301,1310 **** resolve_virtual_fun_from_obj_type_ref (tree ref) { tree obj_type = TREE_TYPE (OBJ_TYPE_REF_OBJECT (ref)); ! int index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1); tree fun = BINFO_VIRTUALS (TYPE_BINFO (TREE_TYPE (obj_type))); ! while (index--) fun = TREE_CHAIN (fun); return BV_FN (fun); } --- 1304,1317 ---- resolve_virtual_fun_from_obj_type_ref (tree ref) { tree obj_type = TREE_TYPE (OBJ_TYPE_REF_OBJECT (ref)); ! HOST_WIDE_INT index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1); tree fun = BINFO_VIRTUALS (TYPE_BINFO (TREE_TYPE (obj_type))); ! while (index) ! { fun = TREE_CHAIN (fun); + index -= (TARGET_VTABLE_USES_DESCRIPTORS + ? TARGET_VTABLE_USES_DESCRIPTORS : 1); + } return BV_FN (fun); } *************** dump_expr (tree t, int flags) *** 1420,1432 **** if (TREE_CODE (ob) == ADDR_EXPR) { dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS); ! pp_dot (cxx_pp); } else if (TREE_CODE (ob) != PARM_DECL || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this")) { dump_expr (ob, flags | TFF_EXPR_IN_PARENS); ! pp_arrow (cxx_pp); } args = TREE_CHAIN (args); } --- 1427,1439 ---- if (TREE_CODE (ob) == ADDR_EXPR) { dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS); ! pp_cxx_dot (cxx_pp); } else if (TREE_CODE (ob) != PARM_DECL || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this")) { dump_expr (ob, flags | TFF_EXPR_IN_PARENS); ! pp_cxx_arrow (cxx_pp); } args = TREE_CHAIN (args); } diff -Nrcpad gcc-4.2.1/gcc/cp/except.c gcc-4.2.2/gcc/cp/except.c *** gcc-4.2.1/gcc/cp/except.c Sat Sep 2 06:54:04 2006 --- gcc-4.2.2/gcc/cp/except.c Tue Sep 11 15:20:47 2007 *************** *** 1,6 **** /* Handle exceptional things in C++. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann Rewritten by Mike Stump , based upon an initial re-implementation courtesy Tad Hunt. --- 1,6 ---- /* Handle exceptional things in C++. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ! 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann Rewritten by Mike Stump , based upon an initial re-implementation courtesy Tad Hunt. *************** This file is part of GCC. *** 9,15 **** GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 9,15 ---- GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 18,26 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" --- 18,25 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" *************** prepare_eh_type (tree type) *** 116,121 **** --- 115,123 ---- /* Peel off cv qualifiers. */ type = TYPE_MAIN_VARIANT (type); + /* Functions and arrays decay to pointers. */ + type = type_decays_to (type); + return type; } *************** initialize_handler_parm (tree decl, tree *** 389,394 **** --- 391,399 ---- See also expand_default_init. */ init = ocp_convert (TREE_TYPE (decl), init, CONV_IMPLICIT|CONV_FORCE_TEMP, 0); + /* Force cleanups now to avoid nesting problems with the + MUST_NOT_THROW_EXPR. */ + init = fold_build_cleanup_point_expr (TREE_TYPE (init), init); init = build1 (MUST_NOT_THROW_EXPR, TREE_TYPE (init), init); } diff -Nrcpad gcc-4.2.1/gcc/cp/expr.c gcc-4.2.2/gcc/cp/expr.c *** gcc-4.2.1/gcc/cp/expr.c Wed Dec 7 21:55:19 2005 --- gcc-4.2.2/gcc/cp/expr.c Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** /* Convert language-specific tree expression to rtl instructions, for GNU compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,13 ---- /* Convert language-specific tree expression to rtl instructions, for GNU compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" --- 16,23 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" diff -Nrcpad gcc-4.2.1/gcc/cp/friend.c gcc-4.2.2/gcc/cp/friend.c *** gcc-4.2.1/gcc/cp/friend.c Thu Feb 22 19:57:55 2007 --- gcc-4.2.2/gcc/cp/friend.c Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** /* Help friends in C++. ! Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 ! Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,12 ---- /* Help friends in C++. ! Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, ! 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 15,23 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" --- 15,22 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" diff -Nrcpad gcc-4.2.1/gcc/cp/g++spec.c gcc-4.2.2/gcc/cp/g++spec.c *** gcc-4.2.1/gcc/cp/g++spec.c Fri Aug 25 00:24:10 2006 --- gcc-4.2.2/gcc/cp/g++spec.c Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** /* Specific flags and argument handling of the C++ front-end. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 ! Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,12 ---- /* Specific flags and argument handling of the C++ front-end. ! Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ! 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 15,23 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" --- 15,22 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" diff -Nrcpad gcc-4.2.1/gcc/cp/init.c gcc-4.2.2/gcc/cp/init.c *** gcc-4.2.1/gcc/cp/init.c Sat Jul 7 02:02:37 2007 --- gcc-4.2.2/gcc/cp/init.c Thu Sep 20 10:04:19 2007 *************** *** 1,13 **** /* Handle initialization things in C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,13 ---- /* Handle initialization things in C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* High-level class interface. */ --- 16,23 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* High-level class interface. */ *************** initialize_vtbl_ptrs (tree addr) *** 137,147 **** /* Return an expression for the zero-initialization of an object with type T. This expression will either be a constant (in the case that T is a scalar), or a CONSTRUCTOR (in the case that T is an ! aggregate). In either case, the value can be used as DECL_INITIAL ! for a decl of the indicated TYPE; it is a valid static initializer. ! If NELTS is non-NULL, and TYPE is an ARRAY_TYPE, NELTS is the ! number of elements in the array. If STATIC_STORAGE_P is TRUE, ! initializers are only generated for entities for which zero-initialization does not simply mean filling the storage with zero bytes. */ --- 136,147 ---- /* Return an expression for the zero-initialization of an object with type T. This expression will either be a constant (in the case that T is a scalar), or a CONSTRUCTOR (in the case that T is an ! aggregate), or NULL (in the case that T does not require ! initialization). In either case, the value can be used as ! DECL_INITIAL for a decl of the indicated TYPE; it is a valid static ! initializer. If NELTS is non-NULL, and TYPE is an ARRAY_TYPE, NELTS ! is the number of elements in the array. If STATIC_STORAGE_P is ! TRUE, initializers are only generated for entities for which zero-initialization does not simply mean filling the storage with zero bytes. */ *************** build_zero_init (tree type, tree nelts, *** 200,206 **** tree value = build_zero_init (TREE_TYPE (field), /*nelts=*/NULL_TREE, static_storage_p); ! CONSTRUCTOR_APPEND_ELT(v, field, value); } /* For unions, only the first field is initialized. */ --- 200,207 ---- tree value = build_zero_init (TREE_TYPE (field), /*nelts=*/NULL_TREE, static_storage_p); ! if (value) ! CONSTRUCTOR_APPEND_ELT(v, field, value); } /* For unions, only the first field is initialized. */ *************** build_delete (tree type, tree addr, spec *** 2789,2794 **** --- 2790,2796 ---- } else { + tree head = NULL_TREE; tree do_delete = NULL_TREE; tree ifexp; *************** build_delete (tree type, tree addr, spec *** 2802,2809 **** { /* We will use ADDR multiple times so we must save it. */ addr = save_expr (addr); /* Delete the object. */ ! do_delete = build_builtin_delete_call (addr); /* Otherwise, treat this like a complete object destructor call. */ auto_delete = sfk_complete_destructor; --- 2804,2812 ---- { /* We will use ADDR multiple times so we must save it. */ addr = save_expr (addr); + head = get_target_expr (build_headof (addr)); /* Delete the object. */ ! do_delete = build_builtin_delete_call (head); /* Otherwise, treat this like a complete object destructor call. */ auto_delete = sfk_complete_destructor; *************** build_delete (tree type, tree addr, spec *** 2842,2847 **** --- 2845,2854 ---- if (do_delete) expr = build2 (COMPOUND_EXPR, void_type_node, expr, do_delete); + /* We need to calculate this before the dtor changes the vptr. */ + if (head) + expr = build2 (COMPOUND_EXPR, void_type_node, head, expr); + if (flags & LOOKUP_DESTRUCTOR) /* Explicit destructor call; don't check for null pointer. */ ifexp = integer_one_node; diff -Nrcpad gcc-4.2.1/gcc/cp/lang-specs.h gcc-4.2.2/gcc/cp/lang-specs.h *** gcc-4.2.1/gcc/cp/lang-specs.h Fri Aug 25 00:24:10 2006 --- gcc-4.2.2/gcc/cp/lang-specs.h Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** /* Definitions for specs for C++. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, ! 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,12 ---- /* Definitions for specs for C++. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, ! 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 15,23 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* This is the contribution to the `default_compilers' array in gcc.c for g++. */ --- 15,22 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* This is the contribution to the `default_compilers' array in gcc.c for g++. */ diff -Nrcpad gcc-4.2.1/gcc/cp/lex.c gcc-4.2.2/gcc/cp/lex.c *** gcc-4.2.1/gcc/cp/lex.c Thu Sep 7 06:53:21 2006 --- gcc-4.2.2/gcc/cp/lex.c Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** /* Separate lexical analyzer for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,14 ---- /* Separate lexical analyzer for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 ! Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* This file is the lexical analyzer for GNU C++. */ --- 17,24 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* This file is the lexical analyzer for GNU C++. */ *************** make_aggr_type (enum tree_code code) *** 827,829 **** --- 827,844 ---- return t; } + + /* Returns true if we are currently in the main source file, or in a + template instantiation started from the main source file. */ + + bool + in_main_input_context (void) + { + tree tl = outermost_tinst_level(); + + if (tl) + return strcmp (main_input_filename, + LOCATION_FILE (TINST_LOCATION (tl))) == 0; + else + return strcmp (main_input_filename, input_filename) == 0; + } diff -Nrcpad gcc-4.2.1/gcc/cp/mangle.c gcc-4.2.2/gcc/cp/mangle.c *** gcc-4.2.1/gcc/cp/mangle.c Sat Aug 26 16:23:33 2006 --- gcc-4.2.2/gcc/cp/mangle.c Fri Aug 31 08:27:50 2007 *************** *** 1,5 **** /* Name mangling for the 3.0 C++ ABI. ! Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Written by Alex Samuel --- 1,5 ---- /* Name mangling for the 3.0 C++ ABI. ! Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Alex Samuel *************** *** 7,13 **** GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but --- 7,13 ---- GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but *************** *** 15,24 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to the Free ! Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ! 02110-1301, USA. */ /* This file implements mangling of C++ names according to the IA64 C++ ABI specification. A mangled name encodes a function or --- 15,23 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* This file implements mangling of C++ names according to the IA64 C++ ABI specification. A mangled name encodes a function or diff -Nrcpad gcc-4.2.1/gcc/cp/method.c gcc-4.2.2/gcc/cp/method.c *** gcc-4.2.1/gcc/cp/method.c Tue Oct 17 22:35:29 2006 --- gcc-4.2.2/gcc/cp/method.c Fri Aug 31 08:27:50 2007 *************** *** 1,14 **** /* Handle the hair of processing (but not expanding) inline functions. Also manage function and variable name overloading. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,15 ---- /* Handle the hair of processing (but not expanding) inline functions. Also manage function and variable name overloading. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 ! Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 17,25 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* Handle method declarations. */ --- 18,25 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* Handle method declarations. */ diff -Nrcpad gcc-4.2.1/gcc/cp/name-lookup.c gcc-4.2.2/gcc/cp/name-lookup.c *** gcc-4.2.1/gcc/cp/name-lookup.c Wed Sep 6 01:15:09 2006 --- gcc-4.2.2/gcc/cp/name-lookup.c Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** /* Definitions for C++ name lookup routines. ! Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,13 ---- /* Definitions for C++ name lookup routines. ! Copyright (C) 2003, 2004, 2005, 2006, 2007 ! Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 15,23 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" --- 16,23 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" *************** set_decl_namespace (tree decl, tree scop *** 2924,2930 **** /* See whether this has been declared in the namespace. */ old = lookup_qualified_name (scope, DECL_NAME (decl), false, true); ! if (!old) /* No old declaration at all. */ goto complain; if (!is_overloaded_fn (decl)) --- 2924,2930 ---- /* See whether this has been declared in the namespace. */ old = lookup_qualified_name (scope, DECL_NAME (decl), false, true); ! if (old == error_mark_node) /* No old declaration at all. */ goto complain; if (!is_overloaded_fn (decl)) *************** lookup_name_real (tree name, int prefer_ *** 3996,4003 **** if (binding) { ! /* Only namespace-scope bindings can be hidden. */ ! gcc_assert (!hidden_name_p (binding)); val = binding; break; } --- 3996,4044 ---- if (binding) { ! if (hidden_name_p (binding)) ! { ! /* A non namespace-scope binding can only be hidden if ! we are in a local class, due to friend declarations. ! In particular, consider: ! ! void f() { ! struct A { ! friend struct B; ! void g() { B* b; } // error: B is hidden ! } ! struct B {}; ! } ! ! The standard says that "B" is a local class in "f" ! (but not nested within "A") -- but that name lookup ! for "B" does not find this declaration until it is ! declared directly with "f". ! ! In particular: ! ! [class.friend] ! ! If a friend declaration appears in a local class and ! the name specified is an unqualified name, a prior ! declaration is looked up without considering scopes ! that are outside the innermost enclosing non-class ! scope. For a friend class declaration, if there is no ! prior declaration, the class that is specified ! belongs to the innermost enclosing non-class scope, ! but if it is subsequently referenced, its name is not ! found by name lookup until a matching declaration is ! provided in the innermost enclosing nonclass scope. ! */ ! gcc_assert (current_class_type && ! LOCAL_CLASS_P (current_class_type)); ! ! /* This binding comes from a friend declaration in the local ! class. The standard (11.4.8) states that the lookup can ! only succeed if there is a non-hidden declaration in the ! current scope, which is not the case here. */ ! POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE); ! } val = binding; break; } diff -Nrcpad gcc-4.2.1/gcc/cp/name-lookup.h gcc-4.2.2/gcc/cp/name-lookup.h *** gcc-4.2.1/gcc/cp/name-lookup.h Tue Jun 6 11:44:09 2006 --- gcc-4.2.2/gcc/cp/name-lookup.h Fri Aug 31 08:27:50 2007 *************** *** 1,12 **** /* Declarations for C++ name lookup routines. ! Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,12 ---- /* Declarations for C++ name lookup routines. ! Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 15,23 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #ifndef GCC_CP_NAME_LOOKUP_H #define GCC_CP_NAME_LOOKUP_H --- 15,22 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #ifndef GCC_CP_NAME_LOOKUP_H #define GCC_CP_NAME_LOOKUP_H diff -Nrcpad gcc-4.2.1/gcc/cp/operators.def gcc-4.2.2/gcc/cp/operators.def *** gcc-4.2.1/gcc/cp/operators.def Mon Aug 14 23:13:54 2006 --- gcc-4.2.2/gcc/cp/operators.def Fri Aug 31 08:27:50 2007 *************** *** 5,17 **** non-overloadable operators (like the `?:' ternary operator). Written by Mark Mitchell ! Copyright (C) 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 5,18 ---- non-overloadable operators (like the `?:' ternary operator). Written by Mark Mitchell ! Copyright (C) 2000, 2001, 2002, 2003, 2005, 2007 ! Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 20,28 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* The DEF_OPERATOR macro takes the following arguments: --- 21,28 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* The DEF_OPERATOR macro takes the following arguments: diff -Nrcpad gcc-4.2.1/gcc/cp/optimize.c gcc-4.2.2/gcc/cp/optimize.c *** gcc-4.2.1/gcc/cp/optimize.c Fri Mar 9 23:02:28 2007 --- gcc-4.2.2/gcc/cp/optimize.c Fri Aug 31 08:27:50 2007 *************** *** 1,5 **** /* Perform optimizations on tree structure. ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 Free Software Foundation, Inc. Written by Mark Michell (mark@codesourcery.com). --- 1,5 ---- /* Perform optimizations on tree structure. ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Mark Michell (mark@codesourcery.com). *************** This file is part of GCC. *** 7,13 **** GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but --- 7,13 ---- GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to the Free ! Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ! 02110-1301, USA. */ #include "config.h" #include "system.h" --- 16,23 ---- General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" diff -Nrcpad gcc-4.2.1/gcc/cp/parser.c gcc-4.2.2/gcc/cp/parser.c *** gcc-4.2.1/gcc/cp/parser.c Sat Jul 7 02:02:37 2007 --- gcc-4.2.2/gcc/cp/parser.c Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** /* C++ Parser. Copyright (C) 2000, 2001, 2002, 2003, 2004, ! 2005 Free Software Foundation, Inc. Written by Mark Mitchell . This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but --- 1,13 ---- /* C++ Parser. Copyright (C) 2000, 2001, 2002, 2003, 2004, ! 2005, 2007 Free Software Foundation, Inc. Written by Mark Mitchell . This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but *************** *** 15,24 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to the Free ! Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ! 02110-1301, USA. */ #include "config.h" #include "system.h" --- 15,23 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" diff -Nrcpad gcc-4.2.1/gcc/cp/pt.c gcc-4.2.2/gcc/cp/pt.c *** gcc-4.2.1/gcc/cp/pt.c Sat Jul 7 19:16:09 2007 --- gcc-4.2.2/gcc/cp/pt.c Sun Sep 9 18:58:52 2007 *************** *** 1,6 **** /* Handle parameterized types (templates) for GNU C++. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ! 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. Rewritten by Jason Merrill (jason@cygnus.com). --- 1,6 ---- /* Handle parameterized types (templates) for GNU C++. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ! 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. Rewritten by Jason Merrill (jason@cygnus.com). *************** This file is part of GCC. *** 8,14 **** GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 8,14 ---- GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 17,25 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* Known bugs or deficiencies include: --- 17,24 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* Known bugs or deficiencies include: *************** get_innermost_template_args (tree args, *** 508,513 **** --- 507,543 ---- return new_args; } + /* The inverse of get_innermost_template_args: Return all but the innermost + EXTRA_LEVELS levels of template arguments from the ARGS. */ + + static tree + strip_innermost_template_args (tree args, int extra_levels) + { + tree new_args; + int n = TMPL_ARGS_DEPTH (args) - extra_levels; + int i; + + gcc_assert (n >= 0); + + /* If N is 1, just return the outermost set of template arguments. */ + if (n == 1) + return TMPL_ARGS_LEVEL (args, 1); + + /* If we're not removing anything, just return the arguments we were + given. */ + gcc_assert (extra_levels >= 0); + if (extra_levels == 0) + return args; + + /* Make a new set of arguments, not containing the inner arguments. */ + new_args = make_tree_vec (n); + for (i = 1; i <= n; ++i) + SET_TMPL_ARGS_LEVEL (new_args, i, + TMPL_ARGS_LEVEL (args, i)); + + return new_args; + } + /* We've got a template header coming up; push to a new level for storing the parms. */ *************** check_explicit_specialization (tree decl *** 1971,1977 **** context. */ fns = lookup_qualified_name (CP_DECL_CONTEXT (decl), dname, false, true); ! if (!fns || !is_overloaded_fn (fns)) { error ("%qD is not a template function", dname); fns = error_mark_node; --- 2001,2007 ---- context. */ fns = lookup_qualified_name (CP_DECL_CONTEXT (decl), dname, false, true); ! if (fns == error_mark_node || !is_overloaded_fn (fns)) { error ("%qD is not a template function", dname); fns = error_mark_node; *************** reopen_tinst_level (tree level) *** 5288,5293 **** --- 5318,5332 ---- pop_tinst_level (); } + /* Returns the TINST_LEVEL which gives the original instantiation + context. */ + + tree + outermost_tinst_level (void) + { + return tree_last (current_tinst_level); + } + /* DECL is a friend FUNCTION_DECL or TEMPLATE_DECL. ARGS is the vector of template arguments, as for tsubst. *************** unify (tree tparms, tree targs, tree par *** 10453,10458 **** --- 10492,10499 ---- case TEMPLATE_TEMPLATE_PARM: case BOUND_TEMPLATE_TEMPLATE_PARM: tparm = TREE_VALUE (TREE_VEC_ELT (tparms, 0)); + if (tparm == error_mark_node) + return 1; if (TEMPLATE_TYPE_LEVEL (parm) != template_decl_level (tparm)) *************** most_specialized_class (tree type, tree *** 11511,11530 **** int fate; bool ambiguous_p; tree args; tmpl = most_general_template (tmpl); args = CLASSTYPE_TI_ARGS (type); for (t = DECL_TEMPLATE_SPECIALIZATIONS (tmpl); t; t = TREE_CHAIN (t)) { tree partial_spec_args; tree spec_args; partial_spec_args = CLASSTYPE_TI_ARGS (TREE_TYPE (t)); ! spec_args = get_class_bindings (TREE_VALUE (t), partial_spec_args, args); if (spec_args) { list = tree_cons (spec_args, TREE_VALUE (t), list); TREE_TYPE (list) = TREE_TYPE (t); } --- 11552,11608 ---- int fate; bool ambiguous_p; tree args; + tree outer_args = NULL_TREE; tmpl = most_general_template (tmpl); args = CLASSTYPE_TI_ARGS (type); + + /* For determining which partial specialization to use, only the + innermost args are interesting. */ + if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (args)) + { + outer_args = strip_innermost_template_args (args, 1); + args = INNERMOST_TEMPLATE_ARGS (args); + } + for (t = DECL_TEMPLATE_SPECIALIZATIONS (tmpl); t; t = TREE_CHAIN (t)) { tree partial_spec_args; tree spec_args; + tree parms = TREE_VALUE (t); partial_spec_args = CLASSTYPE_TI_ARGS (TREE_TYPE (t)); ! if (outer_args) ! { ! int i; ! ! ++processing_template_decl; ! ! /* Discard the outer levels of args, and then substitute in the ! template args from the enclosing class. */ ! partial_spec_args = INNERMOST_TEMPLATE_ARGS (partial_spec_args); ! partial_spec_args = tsubst_template_args ! (partial_spec_args, outer_args, tf_none, NULL_TREE); ! ! /* PARMS already refers to just the innermost parms, but the ! template parms in partial_spec_args had their levels lowered ! by tsubst, so we need to do the same for the parm list. We ! can't just tsubst the TREE_VEC itself, as tsubst wants to ! treat a TREE_VEC as an argument vector. */ ! parms = copy_node (parms); ! for (i = TREE_VEC_LENGTH (parms) - 1; i >= 0; --i) ! TREE_VEC_ELT (parms, i) = ! tsubst (TREE_VEC_ELT (parms, i), outer_args, tf_none, NULL_TREE); ! ! --processing_template_decl; ! } ! spec_args = get_class_bindings (parms, partial_spec_args, args); if (spec_args) { + if (outer_args) + spec_args = add_to_template_args (outer_args, spec_args); list = tree_cons (spec_args, TREE_VALUE (t), list); TREE_TYPE (list) = TREE_TYPE (t); } diff -Nrcpad gcc-4.2.1/gcc/cp/ptree.c gcc-4.2.2/gcc/cp/ptree.c *** gcc-4.2.1/gcc/cp/ptree.c Tue Jun 6 11:44:09 2006 --- gcc-4.2.2/gcc/cp/ptree.c Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** /* Prints out trees in human readable form. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,14 ---- /* Prints out trees in human readable form. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 ! Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" --- 17,24 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" diff -Nrcpad gcc-4.2.1/gcc/cp/repo.c gcc-4.2.2/gcc/cp/repo.c *** gcc-4.2.1/gcc/cp/repo.c Sat Sep 2 06:52:24 2006 --- gcc-4.2.2/gcc/cp/repo.c Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** /* Code to maintain a C++ template repository. ! Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005 ! Free Software Foundation, Inc. Contributed by Jason Merrill (jason@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,13 ---- /* Code to maintain a C++ template repository. ! Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, ! 2007 Free Software Foundation, Inc. Contributed by Jason Merrill (jason@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* My strategy here is as follows: --- 16,23 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* My strategy here is as follows: diff -Nrcpad gcc-4.2.1/gcc/cp/rtti.c gcc-4.2.2/gcc/cp/rtti.c *** gcc-4.2.1/gcc/cp/rtti.c Tue Oct 24 08:38:26 2006 --- gcc-4.2.2/gcc/cp/rtti.c Thu Sep 13 13:42:11 2007 *************** *** 1,6 **** /* RunTime Type Identification Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ! 2005, 2006 Free Software Foundation, Inc. Mostly written by Jason Merrill (jason@cygnus.com). --- 1,6 ---- /* RunTime Type Identification Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, ! 2005, 2006, 2007 Free Software Foundation, Inc. Mostly written by Jason Merrill (jason@cygnus.com). *************** This file is part of GCC. *** 8,14 **** GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 8,14 ---- GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 17,25 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" --- 17,24 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" *************** VEC(tree,gc) *unemitted_tinfo_decls; *** 101,107 **** and are generated as needed. */ static GTY (()) VEC(tinfo_s,gc) *tinfo_descs; - static tree build_headof (tree); static tree ifnonnull (tree, tree); static tree tinfo_name (tree); static tree build_dynamic_cast_1 (tree, tree); --- 100,105 ---- *************** init_rtti_processing (void) *** 155,161 **** virtual functions (TYPE_POLYMORPHIC_P), else just return the expression. */ ! static tree build_headof (tree exp) { tree type = TREE_TYPE (exp); --- 153,159 ---- virtual functions (TYPE_POLYMORPHIC_P), else just return the expression. */ ! tree build_headof (tree exp) { tree type = TREE_TYPE (exp); diff -Nrcpad gcc-4.2.1/gcc/cp/search.c gcc-4.2.2/gcc/cp/search.c *** gcc-4.2.1/gcc/cp/search.c Thu Feb 22 19:57:55 2007 --- gcc-4.2.2/gcc/cp/search.c Fri Aug 31 09:57:50 2007 *************** *** 1,14 **** /* Breadth-first and depth-first routines for searching multiple-inheritance lattice for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,14 ---- /* Breadth-first and depth-first routines for searching multiple-inheritance lattice for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 17,25 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* High-level class interface. */ --- 17,24 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* High-level class interface. */ *************** lookup_member (tree xbasetype, tree name *** 1200,1205 **** --- 1199,1207 ---- const char *errstr = 0; + if (name == error_mark_node) + return NULL_TREE; + gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); if (TREE_CODE (xbasetype) == TREE_BINFO) diff -Nrcpad gcc-4.2.1/gcc/cp/semantics.c gcc-4.2.2/gcc/cp/semantics.c *** gcc-4.2.1/gcc/cp/semantics.c Mon Jul 2 13:01:37 2007 --- gcc-4.2.2/gcc/cp/semantics.c Fri Aug 31 08:27:50 2007 *************** *** 3,9 **** building RTL. These routines are used both during actual parsing and during the instantiation of template functions. ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Written by Mark Mitchell (mmitchell@usa.net) based on code found formerly in parse.y and pt.c. --- 3,9 ---- building RTL. These routines are used both during actual parsing and during the instantiation of template functions. ! Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Mark Mitchell (mmitchell@usa.net) based on code found formerly in parse.y and pt.c. *************** *** 12,18 **** GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but --- 12,18 ---- GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but *************** *** 20,29 **** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to the Free ! Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA ! 02110-1301, USA. */ #include "config.h" #include "system.h" --- 20,28 ---- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ! You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" *************** finish_label_stmt (tree name) *** 1320,1327 **** void finish_label_decl (tree name) { ! tree decl = declare_local_label (name); ! add_decl_expr (decl); } /* When DECL goes out of scope, make sure that CLEANUP is executed. */ --- 1319,1331 ---- void finish_label_decl (tree name) { ! if (!at_function_scope_p ()) ! { ! error ("__label__ declarations are only allowed in function scopes"); ! return; ! } ! ! add_decl_expr (declare_local_label (name)); } /* When DECL goes out of scope, make sure that CLEANUP is executed. */ diff -Nrcpad gcc-4.2.1/gcc/cp/tree.c gcc-4.2.2/gcc/cp/tree.c *** gcc-4.2.1/gcc/cp/tree.c Mon Mar 5 23:05:29 2007 --- gcc-4.2.2/gcc/cp/tree.c Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** /* Language-dependent node constructors for parse phase of GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,14 ---- /* Language-dependent node constructors for parse phase of GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 ! Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ #include "config.h" #include "system.h" --- 17,24 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ #include "config.h" #include "system.h" diff -Nrcpad gcc-4.2.1/gcc/cp/typeck.c gcc-4.2.2/gcc/cp/typeck.c *** gcc-4.2.1/gcc/cp/typeck.c Wed Jul 4 17:18:22 2007 --- gcc-4.2.2/gcc/cp/typeck.c Fri Aug 31 08:27:50 2007 *************** *** 1,13 **** /* Build expressions with type checking for C++ compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 1,13 ---- /* Build expressions with type checking for C++ compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 16,24 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* This file is part of the C++ front end. --- 16,23 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* This file is part of the C++ front end. *************** check_return_expr (tree retval, bool *no *** 6604,6609 **** --- 6603,6609 ---- && TREE_CODE (retval) == VAR_DECL && DECL_CONTEXT (retval) == current_function_decl && ! TREE_STATIC (retval) + && ! DECL_ANON_UNION_VAR_P (retval) && (DECL_ALIGN (retval) >= DECL_ALIGN (DECL_RESULT (current_function_decl))) && same_type_p ((TYPE_MAIN_VARIANT diff -Nrcpad gcc-4.2.1/gcc/cp/typeck2.c gcc-4.2.2/gcc/cp/typeck2.c *** gcc-4.2.1/gcc/cp/typeck2.c Sat Jul 7 02:02:37 2007 --- gcc-4.2.2/gcc/cp/typeck2.c Fri Aug 31 08:27:50 2007 *************** *** 1,7 **** /* Report error messages, build initializers, and perform some front-end optimizations for C++ compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,7 ---- /* Report error messages, build initializers, and perform some front-end optimizations for C++ compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, ! 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) *************** This file is part of GCC. *** 9,15 **** GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, --- 9,15 ---- GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, *************** MERCHANTABILITY or FITNESS FOR A PARTICU *** 18,26 **** GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING. If not, write to ! the Free Software Foundation, 51 Franklin Street, Fifth Floor, ! Boston, MA 02110-1301, USA. */ /* This file is part of the C++ front end. --- 18,25 ---- GNU General Public License for more details. You should have received a copy of the GNU General Public License ! along with GCC; see the file COPYING3. If not see ! . */ /* This file is part of the C++ front end. diff -Nrcpad gcc-4.2.1/libstdc++-v3/ChangeLog gcc-4.2.2/libstdc++-v3/ChangeLog *** gcc-4.2.1/libstdc++-v3/ChangeLog Thu Jul 19 14:29:35 2007 --- gcc-4.2.2/libstdc++-v3/ChangeLog Sun Oct 7 21:20:04 2007 *************** *** 1,3 **** --- 1,27 ---- + 2007-10-07 Release Manager + + * GCC 4.2.2 released. + + 2007-10-06 Benjamin Kosnik + + PR libstdc++/33678 + * libsupc++/typeinfo (typeinfo): Revert ordering of virtual components. + + 2007-08-28 Paolo Carlini + + PR libstdc++/33128 + * include/tr1/random (uniform_int<>::_M_call): Deal with + __urng() returning negative values. + * testsuite/tr1/5_numerical_facilities/random/uniform_int/33128.cc: + New. + + 2007-08-17 Johannes Willkomm + + PR libstdc++/33084 + * include/std/valarray (operator _Op(const _Tp&, + const valarray<>&)): Fix typo. + * testsuite/26_numerics/numeric_arrays/valarray/33084.cc: New. + 2007-07-19 Release Manager * GCC 4.2.1 released. diff -Nrcpad gcc-4.2.1/libstdc++-v3/include/std/std_valarray.h gcc-4.2.2/libstdc++-v3/include/std/std_valarray.h *** gcc-4.2.1/libstdc++-v3/include/std/std_valarray.h Mon Jan 15 16:45:44 2007 --- gcc-4.2.2/libstdc++-v3/include/std/std_valarray.h Fri Aug 17 09:28:09 2007 *************** _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNME *** 1010,1016 **** { \ typedef _BinClos<_Name, _Constant, _ValArray, _Tp, _Tp> _Closure; \ typedef typename __fun<_Name, _Tp>::result_type _Rt; \ ! return _Expr<_Closure, _Tp>(_Closure(__t, __v)); \ } _DEFINE_BINARY_OPERATOR(+, __plus) --- 1010,1016 ---- { \ typedef _BinClos<_Name, _Constant, _ValArray, _Tp, _Tp> _Closure; \ typedef typename __fun<_Name, _Tp>::result_type _Rt; \ ! return _Expr<_Closure, _Rt>(_Closure(__t, __v)); \ } _DEFINE_BINARY_OPERATOR(+, __plus) diff -Nrcpad gcc-4.2.1/libstdc++-v3/include/tr1/random gcc-4.2.2/libstdc++-v3/include/tr1/random *** gcc-4.2.1/libstdc++-v3/include/tr1/random Sat Apr 7 08:38:39 2007 --- gcc-4.2.2/libstdc++-v3/include/tr1/random Tue Aug 28 08:48:54 2007 *************** _GLIBCXX_BEGIN_NAMESPACE(tr1) *** 1618,1624 **** result_type _M_call(_UniformRandomNumberGenerator& __urng, result_type __min, result_type __max, true_type) ! { return result_type(__urng() % (__max - __min + 1)) + __min; } template result_type --- 1618,1628 ---- result_type _M_call(_UniformRandomNumberGenerator& __urng, result_type __min, result_type __max, true_type) ! { ! typedef typename __gnu_cxx::__add_unsigned::__type __utype; ! return result_type(__utype(__urng()) % (__max - __min + 1)) + __min; ! } template result_type diff -Nrcpad gcc-4.2.1/libstdc++-v3/libsupc++/typeinfo gcc-4.2.2/libstdc++-v3/libsupc++/typeinfo *** gcc-4.2.1/libstdc++-v3/libsupc++/typeinfo Tue Jun 26 15:35:42 2007 --- gcc-4.2.2/libstdc++-v3/libsupc++/typeinfo Sat Oct 6 23:48:31 2007 *************** namespace std *** 99,105 **** #endif bool operator!=(const type_info& __arg) const { return !operator==(__arg); } ! // Try and catch a thrown type. Store an adjusted pointer to the // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then // THR_OBJ points to the thrown object. If THR_TYPE is a pointer --- 99,111 ---- #endif bool operator!=(const type_info& __arg) const { return !operator==(__arg); } ! ! // Return true if this is a pointer type of some kind ! virtual bool __is_pointer_p() const; ! ! // Return true if this is a function type ! virtual bool __is_function_p() const; ! // Try and catch a thrown type. Store an adjusted pointer to the // caught type in THR_OBJ. If THR_TYPE is not a pointer type, then // THR_OBJ points to the thrown object. If THR_TYPE is a pointer *************** namespace std *** 113,124 **** virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target, void **__obj_ptr) const; - // Return true if this is a pointer type of some kind - virtual bool __is_pointer_p() const; - - // Return true if this is a function type - virtual bool __is_function_p() const; - protected: const char *__name; --- 119,124 ---- diff -Nrcpad gcc-4.2.1/libstdc++-v3/testsuite/26_numerics/valarray/33084.cc gcc-4.2.2/libstdc++-v3/testsuite/26_numerics/valarray/33084.cc *** gcc-4.2.1/libstdc++-v3/testsuite/26_numerics/valarray/33084.cc Thu Jan 1 00:00:00 1970 --- gcc-4.2.2/libstdc++-v3/testsuite/26_numerics/valarray/33084.cc Fri Aug 17 09:28:09 2007 *************** *** 0 **** --- 1,48 ---- + // Copyright (C) 2007 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free + // software; you can redistribute it and/or modify it under the + // terms of the GNU General Public License as published by the + // Free Software Foundation; either version 2, or (at your option) + // any later version. + + // This library is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + // GNU General Public License for more details. + + // You should have received a copy of the GNU General Public License along + // with this library; see the file COPYING. If not, write to the Free + // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + // USA. + + // As a special exception, you may use this file as part of a free software + // library without restriction. Specifically, if other files instantiate + // templates or use macros or inline functions from this file, or you compile + // this file and link it with other files to produce an executable, this + // file does not by itself cause the resulting executable to be covered by + // the GNU General Public License. This exception does not however + // invalidate any other reasons why the executable file might be covered by + // the GNU General Public License. + + // { dg-do compile } + + #include + + // libstdc++/33084 + void test01() + { + std::valarray vc(char(0), 10); + std::valarray res(10); + char c(0); + + res = vc == vc; + res = vc == c; + res = c == vc; + } + + int main() + { + test01(); + return 0; + } diff -Nrcpad gcc-4.2.1/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/33128.cc gcc-4.2.2/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/33128.cc *** gcc-4.2.1/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/33128.cc Thu Jan 1 00:00:00 1970 --- gcc-4.2.2/libstdc++-v3/testsuite/tr1/5_numerical_facilities/random/uniform_int/33128.cc Tue Aug 28 08:48:54 2007 *************** *** 0 **** --- 1,43 ---- + // Copyright (C) 2007 Free Software Foundation, Inc. + // + // This file is part of the GNU ISO C++ Library. This library is free + // software; you can redistribute it and/or modify it under the + // terms of the GNU General Public License as published by the + // Free Software Foundation; either version 2, or (at your option) + // any later version. + // + // This library is distributed in the hope that it will be useful, + // but WITHOUT ANY WARRANTY; without even the implied warranty of + // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + // GNU General Public License for more details. + // + // You should have received a copy of the GNU General Public License along + // with this library; see the file COPYING. If not, write to the Free + // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + // USA. + + // 5.1.7.1 Class template uniform_int + // 5.1.1 [7] Table 17 + + #include + #include + + // libstdc++/33128 + int test01() + { + bool test __attribute__((unused)) = true; + + std::tr1::mt19937 rng; + std::tr1::uniform_int<> six(1,6); + std::tr1::variate_generator > + die(rng, six); + + int val = die(); + VERIFY( val >= 1 && val <= 6 ); + } + + int main() + { + test01(); + return 0; + }