OSDN Git Service

PR c++/19878
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Feb 2005 02:42:17 +0000 (02:42 +0000)
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 24 Feb 2005 02:42:17 +0000 (02:42 +0000)
* decl.c (grokvardecl): Set DECL_INTERFACE_KNOWN for declarations
with internal linkage.

PR c++/19878
* g++.dg/init/const2.C: New test.

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

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/init/const2.C [new file with mode: 0644]

index c8b3112..0905273 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-23  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/19878
+       * decl.c (grokvardecl): Set DECL_INTERFACE_KNOWN for declarations
+       with internal linkage.
+
 2005-02-23  Alexandre Oliva  <aoliva@redhat.com>
 
        * decl.c (grokvardecl): Don't exempt anonymous types from having
index bf0fb20..cea13b8 100644 (file)
@@ -5950,6 +5950,8 @@ grokvardecl (tree type,
            warning ("non-local variable %q#D uses local type %qT", decl, t);
        }
     }
+  else
+    DECL_INTERFACE_KNOWN (decl) = 1;
 
   return decl;
 }
index ed9f719..6f590f3 100644 (file)
@@ -1,3 +1,8 @@
+2005-02-23  Mark Mitchell  <mark@codesourcery.com>
+
+       PR c++/19878
+       * g++.dg/init/const2.C: New test.
+
 2005-02-23  Hans-Peter Nilsson  <hp@axis.com>
 
        PR tree-optimization/20100
diff --git a/gcc/testsuite/g++.dg/init/const2.C b/gcc/testsuite/g++.dg/init/const2.C
new file mode 100644 (file)
index 0000000..4fd6318
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/19878
+
+struct S {
+  char k;
+};
+char const volatile S::* const p01 = &S::k;
+