aboutsummaryrefslogtreecommitdiff
path: root/odb/context.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-01-19 10:11:49 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-01-19 10:11:49 +0200
commitb56b9c6796d8853758f0f5967488260d61b788e2 (patch)
treec20c08a1ed94330101a25a7a626f5b523134f19b /odb/context.cxx
parent85cf21db471a4ea9549f3b6f2384578b286dfc23 (diff)
Prevent inner self-typedefs from causing scope cyclesHEADmaster
Diffstat (limited to 'odb/context.cxx')
-rw-r--r--odb/context.cxx25
1 files changed, 18 insertions, 7 deletions
diff --git a/odb/context.cxx b/odb/context.cxx
index dd4019a..13fc1b3 100644
--- a/odb/context.cxx
+++ b/odb/context.cxx
@@ -1472,7 +1472,7 @@ utype (semantics::data_member& m,
}
}
- if (s->global_scope ())
+ if (!s->named_p () || s->global_scope ())
break;
}
@@ -1882,8 +1882,13 @@ schema (semantics::scope& s) const
namespace_* ns (dynamic_cast<namespace_*> (ps));
- if (ns == 0)
- continue; // Some other scope.
+ if (ns == 0) // Some other scope.
+ {
+ if (!ps->named_p ())
+ break;
+
+ continue;
+ }
if (ns->extension ())
ns = &ns->original ();
@@ -1920,7 +1925,8 @@ schema (semantics::scope& s) const
n.swap (r);
}
- if (r.fully_qualified () || ns->global_scope ())
+ if (r.fully_qualified () ||
+ ns->global_scope ()) // Note: namespaces always named.
break;
}
@@ -1952,8 +1958,13 @@ table_name_prefix (semantics::scope& s) const
namespace_* ns (dynamic_cast<namespace_*> (ps));
- if (ns == 0)
- continue; // Some other scope.
+ if (ns == 0) // Some other scope.
+ {
+ if (!ps->named_p ())
+ break;
+
+ continue;
+ }
if (ns->extension ())
ns = &ns->original ();
@@ -1964,7 +1975,7 @@ table_name_prefix (semantics::scope& s) const
r = n.uname () + r;
}
- if (ns->global_scope ())
+ if (ns->global_scope ()) // Note: namespaces always named.
break;
}