diff options
author | Brad King <brad.king@kitware.com> | 2016-03-15 20:50:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-03-16 13:35:25 (GMT) |
commit | 85f0c93da63741a2bb268ac6b3f6f900305bbd00 (patch) | |
tree | c1702a371317da0c887f5f4c2244b4917babee50 /test/input | |
parent | 8c3254367271184ef9b818171f09d262482e5301 (diff) | |
download | CastXML-85f0c93da63741a2bb268ac6b3f6f900305bbd00.zip CastXML-85f0c93da63741a2bb268ac6b3f6f900305bbd00.tar.gz CastXML-85f0c93da63741a2bb268ac6b3f6f900305bbd00.tar.bz2 |
Output: Print fully qualified declarations named in default arguments
In code like
namespace ns {
static int const C = 0;
void f(int = C);
}
we previously generated `default="C"` for the default argument of `f`
because Clang prints the expression as it was written in the source.
GCC-XML would generate the fully qualified name `default="ns::C"`
which is more useful to tools reading the output. Update our default
argument printing to do this by hooking in to Clang's pretty printer
and providing a custom implementation for `DeclRefExpr`.
GitHub-Issue: CastXML/CastXML#51
Diffstat (limited to 'test/input')
-rw-r--r-- | test/input/Function-Argument-default-ns.cxx | 4 | ||||
-rw-r--r-- | test/input/Method-Argument-default.cxx | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/input/Function-Argument-default-ns.cxx b/test/input/Function-Argument-default-ns.cxx new file mode 100644 index 0000000..72a7941 --- /dev/null +++ b/test/input/Function-Argument-default-ns.cxx @@ -0,0 +1,4 @@ +namespace start { + static int const C = 0; + void f(int = C); +} diff --git a/test/input/Method-Argument-default.cxx b/test/input/Method-Argument-default.cxx new file mode 100644 index 0000000..dfd86ae --- /dev/null +++ b/test/input/Method-Argument-default.cxx @@ -0,0 +1,4 @@ +class start { + static int const C = 0; + int method(int = C); +}; |