summaryrefslogtreecommitdiffstats
path: root/test/input/Namespace-inline-template.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-15 19:51:25 (GMT)
committerBrad King <brad.king@kitware.com>2015-05-15 19:51:25 (GMT)
commitd741c9e4e56ff43dc35603327f1a8d30c8bb167c (patch)
tree6b9cc06532204d3ff7c8b5fa751cbef4e976ec83 /test/input/Namespace-inline-template.cxx
parent5587062f5f894d7b2d7a61679a495535db0a8924 (diff)
downloadCastXML-d741c9e4e56ff43dc35603327f1a8d30c8bb167c.zip
CastXML-d741c9e4e56ff43dc35603327f1a8d30c8bb167c.tar.gz
CastXML-d741c9e4e56ff43dc35603327f1a8d30c8bb167c.tar.bz2
Output: Place inline namespace members in containing namespace
An inline namespace affects the linkage of its members but for APIs the members are effectively in the containing namespace. Generate output as if they were really in the containing namespace and do not generate a Namespace element for an inline namespace. If --castxml-start names an inline namespace simply ignore it to avoid dumping a Namespace element for it. One can argue this is valid since the inline namespace should not normally be named in API usage. Set our printing policy to avoid showing the inline namespace component automatically. Note that expressions in the source code that hard-code the inline namespace name will still be preserved and show the inline namespace when printed (e.g. Variable init="" attribute expressions). Suggested-by: Michka Popoff <michkapopoff@gmail.com>
Diffstat (limited to 'test/input/Namespace-inline-template.cxx')
-rw-r--r--test/input/Namespace-inline-template.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/input/Namespace-inline-template.cxx b/test/input/Namespace-inline-template.cxx
new file mode 100644
index 0000000..fc38a46
--- /dev/null
+++ b/test/input/Namespace-inline-template.cxx
@@ -0,0 +1,8 @@
+#pragma clang diagnostic ignored "-Wc++11-extensions"
+namespace start {
+ inline namespace level1 {
+ struct A;
+ }
+ template <typename T> struct B;
+ typedef B<A> B_A;
+}