summaryrefslogtreecommitdiffstats
path: root/test/input
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-03-21 15:28:05 (GMT)
committerBrad King <brad.king@kitware.com>2016-03-21 15:50:17 (GMT)
commit1604e1a7ac8d417509c656135eff489ea970e4d2 (patch)
tree0623c1a652cbb4ada9d4a9d3b274af0064071682 /test/input
parent5a90589770fd53510981f943844cb488eb58bd91 (diff)
downloadCastXML-1604e1a7ac8d417509c656135eff489ea970e4d2.zip
CastXML-1604e1a7ac8d417509c656135eff489ea970e4d2.tar.gz
CastXML-1604e1a7ac8d417509c656135eff489ea970e4d2.tar.bz2
Output: Fix unnamed enum value references in default arguments
In code like namespace ns { enum { E = 0 }; void f(int = E); } we use `clang::NamedDecl::printQualifiedName` to print the fully qualified name of the enum constant `E`. However, the method produces `ns::::E` when the enumeration type itself is not named. Work around this problem by removing one of the `::` from the result. GitHub-Issue: CastXML/CastXML#52
Diffstat (limited to 'test/input')
-rw-r--r--test/input/Function-Argument-default-ns.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/input/Function-Argument-default-ns.cxx b/test/input/Function-Argument-default-ns.cxx
index 72a7941..b2fc53e 100644
--- a/test/input/Function-Argument-default-ns.cxx
+++ b/test/input/Function-Argument-default-ns.cxx
@@ -1,4 +1,5 @@
namespace start {
static int const C = 0;
- void f(int = C);
+ enum { E = 0 };
+ void f(int = C, int = E);
}