This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH: PR 19878


The rule is that whenever a declaration with internal linkage is
created, DECL_INTERFACE_KNOWN should be set because, well, the
interface is known.  The assertion in import_export_decl alerted us to
a case where this rule was not follwed; fixed thusly.

Tested on x86_64-unknown-linux-gnu, applied on the mainline.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

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  Mark Mitchell  <mark@codesourcery.com>

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

Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1368
diff -c -5 -p -r1.1368 decl.c
*** cp/decl.c	23 Feb 2005 06:51:55 -0000	1.1368
--- cp/decl.c	24 Feb 2005 02:38:11 -0000
*************** grokvardecl (tree type,
*** 5956,5965 ****
--- 5956,5967 ----
  	    }
  	  else
  	    pedwarn ("non-local variable %q#D uses local type %qT", decl, t);
  	}
      }
+   else
+     DECL_INTERFACE_KNOWN (decl) = 1;
  
    return decl;
  }
  
  /* Create and return a canonical pointer to member function type, for
Index: testsuite/g++.dg/init/const2.C
===================================================================
RCS file: testsuite/g++.dg/init/const2.C
diff -N testsuite/g++.dg/init/const2.C
*** /dev/null	1 Jan 1970 00:00:00 -0000
--- testsuite/g++.dg/init/const2.C	24 Feb 2005 02:38:12 -0000
***************
*** 0 ****
--- 1,7 ----
+ // PR c++/19878
+ 
+ struct S {
+   char k;
+ };
+ char const volatile S::* const p01 = &S::k;
+ 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]