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]

[PATCH] Fix PR46241


This fixes a missed conversion to translation-unit-decl handling
in dwarf2out.c.

Bootstrapped and tested on x86_64-unknown-linux-gnu, committed.

Richard.

2010-11-03  Richard Guenther  <rguenther@suse.de>

	PR middle-end/46241
	* dwarf2out.c (scope_die_for): Properly detect global scope.

	* g++.dg/debug/pr46241.C: New testcase.

Index: gcc/dwarf2out.c
===================================================================
*** gcc/dwarf2out.c	(revision 166238)
--- gcc/dwarf2out.c	(working copy)
*************** scope_die_for (tree t, dw_die_ref contex
*** 17739,17745 ****
    if (containing_scope && TREE_CODE (containing_scope) == FUNCTION_TYPE)
      containing_scope = NULL_TREE;
  
!   if (containing_scope == NULL_TREE)
      scope_die = comp_unit_die ();
    else if (TYPE_P (containing_scope))
      {
--- 17739,17745 ----
    if (containing_scope && TREE_CODE (containing_scope) == FUNCTION_TYPE)
      containing_scope = NULL_TREE;
  
!   if (SCOPE_FILE_SCOPE_P (containing_scope))
      scope_die = comp_unit_die ();
    else if (TYPE_P (containing_scope))
      {
Index: gcc/testsuite/g++.dg/debug/pr46241.C
===================================================================
*** gcc/testsuite/g++.dg/debug/pr46241.C	(revision 0)
--- gcc/testsuite/g++.dg/debug/pr46241.C	(revision 0)
***************
*** 0 ****
--- 1,19 ----
+ class btIDebugDraw;
+ class btCollisionWorld {
+     virtual btIDebugDraw* getDebugDrawer()  { };
+     static void rayTestSingle();
+ };
+ class btTriangleCallback {
+ public:
+     virtual ~btTriangleCallback();
+ };
+ class btTriangleRaycastCallback: public btTriangleCallback {
+ public:
+     btTriangleRaycastCallback();
+ };
+ void btCollisionWorld::rayTestSingle()
+ {
+   struct BridgeTriangleRaycastCallback : public btTriangleRaycastCallback {
+       BridgeTriangleRaycastCallback() : btTriangleRaycastCallback() { }
+   };
+ }


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