Skip to content

Commit ceecf7d

Browse files
committed
Do the tr1 magic in container traits only on namespaces
1 parent 756549d commit ceecf7d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pygccxml/declarations/container_traits.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from . import cpptypes
1313
from . import templates
1414
from . import type_traits
15+
from . import namespace
1516
from . import class_declaration
1617
from .. import utils
1718

@@ -411,7 +412,8 @@ def get_container_or_none(self, type_):
411412
"declaration starts with " + self.name() + '<')
412413
return
413414

414-
if type_.declaration.parent.name == "tr1":
415+
is_ns = isinstance(type_.declaration.parent, namespace.namespace_t)
416+
if is_ns and type_.declaration.parent.name == "tr1":
415417
# When using libstd++, some container traits are defined in
416418
# std::tr1:: . See remove_template_defaults_tester.py.
417419
# In this case the is_defined_in_xxx test needs to be done

0 commit comments

Comments
 (0)