+++ /dev/null
---- gcc-3.4.5/gcc/cp/g++spec.c.orig 2004-09-29 04:18:58.000000000 +0200
-+++ gcc-3.4.5/gcc/cp/g++spec.c 2005-12-09 04:26:21.215120000 +0100
-@@ -222,6 +222,11 @@ lang_specific_driver (int *in_argc, cons
- {
- if ((len <= 2 || strcmp (argv[i] + (len - 2), ".H") != 0)
- && (len <= 2 || strcmp (argv[i] + (len - 2), ".h") != 0)
-+ && (len <= 4 || strcmp (argv[i] + (len - 4), ".hpp") != 0)
-+ && (len <= 3 || strcmp (argv[i] + (len - 3), ".hp") != 0)
-+ && (len <= 4 || strcmp (argv[i] + (len - 4), ".hxx") != 0)
-+ && (len <= 4 || strcmp (argv[i] + (len - 4), ".h++") != 0)
-+ && (len <= 4 || strcmp (argv[i] + (len - 4), ".HPP") != 0)
- && (len <= 3 || strcmp (argv[i] + (len - 3), ".hh") != 0))
- library = 1;
- }
---- gcc-4_1-branch/gcc/cp/lang-specs.h.orig 2005-11-30 12:09:14.000000000 +0100
-+++ gcc-4_1-branch/gcc/cp/lang-specs.h 2005-12-09 04:51:49.225120000 +0100
-@@ -34,6 +34,12 @@ Boston, MA 02110-1301, USA. */
- {".C", "@c++", 0, 0, 0},
- {".CPP", "@c++", 0, 0, 0},
- {".H", "@c++-header", 0, 0, 0},
-+ {".hpp", "@c++-header", 0, 0, 0},
-+ {".hp", "@c++-header", 0, 0, 0},
-+ {".hxx", "@c++-header", 0, 0, 0},
-+ {".h++", "@c++-header", 0, 0, 0},
-+ {".hpp", "@c++-header", 0, 0, 0},
-+ {".HPP", "@c++-header", 0, 0, 0},
- {".hh", "@c++-header", 0, 0, 0},
- {"@c++-header",
- "%{E|M|MM:cc1plus -E %(cpp_options) %2 %(cpp_debug_options)}\
---- gcc-3.4.5/gcc/doc/invoke.texi.orig 2005-10-08 02:22:20.000000000 +0200
-+++ gcc-3.4.5/gcc/doc/invoke.texi 2005-12-09 04:24:19.085120000 +0100
-@@ -750,6 +750,11 @@ the last two letters must both be litera
- @samp{.C} refers to a literal capital C@.
-
- @item @var{file}.hh
-+@itemx @var{file}.hp
-+@itemx @var{file}.hxx
-+@itemx @var{file}.hpp
-+@itemx @var{file}.HPP
-+@itemx @var{file}.h++
- @itemx @var{file}.H
- C++ header file to be turned into a precompiled header.
-
+++ /dev/null
---- trunk/gcc/config/i386/i386.c (wersja 117926)
-+++ trunk/gcc/config/i386/i386.c (wersja 117927)
-@@ -2951,32 +2951,6 @@
- switch (TREE_CODE (type))
- {
- case RECORD_TYPE:
-- /* For classes first merge in the field of the subclasses. */
-- if (TYPE_BINFO (type))
-- {
-- tree binfo, base_binfo;
-- int basenum;
--
-- for (binfo = TYPE_BINFO (type), basenum = 0;
-- BINFO_BASE_ITERATE (binfo, basenum, base_binfo); basenum++)
-- {
-- int num;
-- int offset = tree_low_cst (BINFO_OFFSET (base_binfo), 0) * 8;
-- tree type = BINFO_TYPE (base_binfo);
--
-- num = classify_argument (TYPE_MODE (type),
-- type, subclasses,
-- (offset + bit_offset) % 256);
-- if (!num)
-- return 0;
-- for (i = 0; i < num; i++)
-- {
-- int pos = (offset + (bit_offset % 64)) / 8 / 8;
-- classes[i + pos] =
-- merge_classes (subclasses[i], classes[i + pos]);
-- }
-- }
-- }
- /* And now merge the fields of structure. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
- {
-@@ -3044,10 +3018,6 @@
- case QUAL_UNION_TYPE:
- /* Unions are similar to RECORD_TYPE but offset is always 0.
- */
--
-- /* Unions are not derived. */
-- gcc_assert (!TYPE_BINFO (type)
-- || !BINFO_N_BASE_BINFOS (TYPE_BINFO (type)));
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == FIELD_DECL)
-@@ -3735,18 +3705,7 @@
- {
- tree field;
-
-- if (TYPE_BINFO (type))
-- {
-- tree binfo, base_binfo;
-- int i;
--
-- for (binfo = TYPE_BINFO (type), i = 0;
-- BINFO_BASE_ITERATE (binfo, i, base_binfo); i++)
-- if (contains_128bit_aligned_vector_p
-- (BINFO_TYPE (base_binfo)))
-- return true;
-- }
-- /* And now merge the fields of structure. */
-+ /* Walk all the structure fields. */
- for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) == FIELD_DECL
+++ /dev/null
-2007-03-20 Pawel Sikora <pluto@pld-linux.org>
-
- PR c++/7302
- * cp/class.c (finish_struct_1): Warn when a class has virtual
- functions and accessible non-virtual destructor.
-
- * doc/invoke.texi (-Wnon-virtual-dtor): Update documentation.
-
- * g++.dg/warn/Wnvdtor-2.C: New testcase.
-
-Index: trunk/gcc/cp/class.c
-===================================================================
---- trunk/gcc/cp/class.c (revision 123085)
-+++ trunk/gcc/cp/class.c (working copy)
-@@ -5105,17 +5105,19 @@
- tree dtor;
-
- dtor = CLASSTYPE_DESTRUCTORS (t);
-- /* Warn only if the dtor is non-private or the class has
-- friends. */
- if (/* An implicitly declared destructor is always public. And,
- if it were virtual, we would have created it by now. */
- !dtor
- || (!DECL_VINDEX (dtor)
-- && (!TREE_PRIVATE (dtor)
-- || CLASSTYPE_FRIEND_CLASSES (t)
-- || DECL_FRIENDLIST (TYPE_MAIN_DECL (t)))))
-- warning (0, "%q#T has virtual functions but non-virtual destructor",
-- t);
-+ && (/* public non-virtual */
-+ (!TREE_PRIVATE (dtor) && !TREE_PROTECTED (dtor))
-+ || (/* non-public non-virtual with friends */
-+ (TREE_PRIVATE (dtor) || TREE_PROTECTED (dtor))
-+ && (CLASSTYPE_FRIEND_CLASSES (t)
-+ || DECL_FRIENDLIST (TYPE_MAIN_DECL (t)))))))
-+ warning (OPT_Wnon_virtual_dtor,
-+ "%q#T has virtual functions and accessible"
-+ " non-virtual destructor", t);
- }
-
- complete_vars (t);
-Index: trunk/gcc/doc/invoke.texi
-===================================================================
---- trunk/gcc/doc/invoke.texi (revision 123085)
-+++ trunk/gcc/doc/invoke.texi (working copy)
-@@ -1945,9 +1945,10 @@
-
- @item -Wnon-virtual-dtor @r{(C++ only)}
- @opindex Wnon-virtual-dtor
--Warn when a class appears to be polymorphic, thereby requiring a virtual
--destructor, yet it declares a non-virtual one. This warning is also
--enabled if -Weffc++ is specified.
-+Warn when a class has virtual functions and accessible non-virtual
-+destructor, in which case it would be possible but unsafe to delete
-+an instance of a derived class through a pointer to the base class.
-+This warning is also enabled if -Weffc++ is specified.
-
- @item -Wreorder @r{(C++ only)}
- @opindex Wreorder
-Index: trunk/gcc/testsuite/g++.dg/warn/Wnvdtor-2.C
-===================================================================
---- trunk/gcc/testsuite/g++.dg/warn/Wnvdtor-2.C (revision 0)
-+++ trunk/gcc/testsuite/g++.dg/warn/Wnvdtor-2.C (revision 0)
-@@ -0,0 +1,54 @@
-+// PR c++/7302
-+// { dg-do compile }
-+// { dg-options "-Wnon-virtual-dtor" }
-+
-+// Warn when a class has virtual functions and accessible non-virtual
-+// destructor, in which case it would be possible but unsafe to delete
-+// an instance of a derived class through a pointer to the base class.
-+
-+struct A
-+{ // { dg-bogus "non-virtual destructor" }
-+protected:
-+ ~A();
-+public:
-+ virtual void f() = 0;
-+};
-+
-+struct B
-+{ // { dg-bogus "non-virtual destructor" }
-+private:
-+ ~B();
-+public:
-+ virtual void f() = 0;
-+};
-+
-+struct C
-+{ // { dg-warning "non-virtual destructor" }
-+ virtual void f() = 0;
-+};
-+
-+struct D
-+{ // { dg-warning "non-virtual destructor" }
-+ ~D();
-+ virtual void f() = 0;
-+};
-+
-+struct E;
-+
-+struct F
-+{ // { dg-warning "non-virtual destructor" }
-+protected:
-+ friend class E;
-+ ~F();
-+public:
-+ virtual void f() = 0;
-+};
-+
-+struct G
-+{ // { dg-warning "non-virtual destructor" }
-+private:
-+ friend class E;
-+ ~G();
-+public:
-+ virtual void f() = 0;
-+};