diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-17 12:53:58 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-17 12:53:58 +0200 |
commit | fa8b674ef4cb32cb92bcc4f3d42bf24b8cf3b7fb (patch) | |
tree | fee686936eb4150208e58ee81164931199c79e0e /odb/semantics/elements.cxx | |
parent | 8f6a9c51bc64226d7c296e4b0172f9e56a7eea3b (diff) |
Diagnose "composite type used before definition" situations
Diffstat (limited to 'odb/semantics/elements.cxx')
-rw-r--r-- | odb/semantics/elements.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/odb/semantics/elements.cxx b/odb/semantics/elements.cxx index 21e3260..43fb379 100644 --- a/odb/semantics/elements.cxx +++ b/odb/semantics/elements.cxx @@ -48,6 +48,23 @@ namespace semantics // bool nameable:: + in_scope (scope_type& s) + { + for (scope_type* p (&scope ());; p = &p->scope_ ()) + { + //@@ Need to handle namespace extensions. + // + if (p == &s) + return true; + + if (p->global_scope ()) + break; + } + + return false; + } + + bool nameable:: anonymous_ () const { tree n (tree_node ()); |