]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR c++/39153
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Feb 2009 02:01:07 +0000 (02:01 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 12 Feb 2009 02:01:07 +0000 (02:01 +0000)
        * decl2.c (cp_write_global_declarations):
        Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@144119 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/defaulted9.C [new file with mode: 0644]

index 58bffd77e2539c55b3cd5da5de4c9049d1d0a6ac..7a764b1a22e43f0ac455c960c37a890f46e18a95 100644 (file)
@@ -1,5 +1,9 @@
 2009-02-11  Jason Merrill  <jason@redhat.com>
 
+       PR c++/39153
+       * decl2.c (cp_write_global_declarations): 
+       Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
+
        PR c++/30111
        * init.c (build_value_init_noctor): Split out from...
        (build_value_init): ...here.
index c8887257ece17cef31d57886738c18b01237eead..2cafc8377656d026293c0c776542d998e90b4226 100644 (file)
@@ -3487,7 +3487,7 @@ cp_write_global_declarations (void)
       for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i)
        {
          /* Does it need synthesizing?  */
-         if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl)
+         if (DECL_DEFAULTED_FN (decl) && ! DECL_INITIAL (decl)
              && (! DECL_REALLY_EXTERN (decl) || possibly_inlined_p (decl)))
            {
              /* Even though we're already at the top-level, we push
index 7c088650e9742d32f70ef5033ea629f8fab69df4..b140c2f1e6de3e0191497547a732d11b9476d159 100644 (file)
@@ -1,5 +1,8 @@
 2009-02-11  Jason Merrill  <jason@redhat.com>
 
+       PR c++/39153
+       * g++.dg/cpp0x/defaulted9.C: New test.
+
        PR c++/30111
        * g++.dg/init/value7.C: New test.
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted9.C b/gcc/testsuite/g++.dg/cpp0x/defaulted9.C
new file mode 100644 (file)
index 0000000..c067065
--- /dev/null
@@ -0,0 +1,17 @@
+// PR c++/39153
+
+struct _Impl_base
+{
+  _Impl_base() = default;
+  virtual ~_Impl_base() = default;
+};
+
+template<typename _Tp>
+class _Impl : public _Impl_base
+{ };
+
+int main()
+{
+  _Impl<int> i;
+  return 0;
+}