diff options
author | Brad King <brad.king@kitware.com> | 2015-04-28 13:45:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-04-28 17:15:00 (GMT) |
commit | f0c00cb8bd3c5e6c38c6ee47370c15630e7446eb (patch) | |
tree | 2889095a7ca034ba79e9485052836c96d56bf3c0 /test/input | |
parent | bafe43d6438fa5ce0ef778d5d713cd7f594370b9 (diff) | |
download | CastXML-f0c00cb8bd3c5e6c38c6ee47370c15630e7446eb.zip CastXML-f0c00cb8bd3c5e6c38c6ee47370c15630e7446eb.tar.gz CastXML-f0c00cb8bd3c5e6c38c6ee47370c15630e7446eb.tar.bz2 |
Output: Refactor generation of CvQualifiedType elements
Previously our handling of cv-qualified types did not account for
multiple locally cv-qualified types encountered through multiple levels
of desugaring. This could lead to CvQualifiedType elements that
reference elements that are generated with a different id.
Refactor our internal representation of dump nodes to keep cv-qualifiers
in the node ids. Teach AddTypeDumpNode to collect cv-qualifiers from
each level of desugaring and compute their union. Once the desugared
unqualified type is found, generate one CvQualifiedType element for the
qualified type, if any.
Update the expected test output to account for the new ordering of
nodes. Mark the Class-template-constructor-template test case as no
longer broken because this approach fixes it. Add test cases covering
cv-qualifiers added at different layers of desugaring (via "T const"
where T is already a "const" type in a template instantiation).
GitHub-Issue: 10
Diffstat (limited to 'test/input')
-rw-r--r-- | test/input/Class-template-Method-Argument-const.cxx | 4 | ||||
-rw-r--r-- | test/input/Class-template-Method-return-const.cxx | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/test/input/Class-template-Method-Argument-const.cxx b/test/input/Class-template-Method-Argument-const.cxx new file mode 100644 index 0000000..76c6c4b --- /dev/null +++ b/test/input/Class-template-Method-Argument-const.cxx @@ -0,0 +1,4 @@ +template <typename T> class start { + void method(T const&); +}; +template class start<int const>; // instantiation diff --git a/test/input/Class-template-Method-return-const.cxx b/test/input/Class-template-Method-return-const.cxx new file mode 100644 index 0000000..28063b4 --- /dev/null +++ b/test/input/Class-template-Method-return-const.cxx @@ -0,0 +1,4 @@ +template <typename T> class start { + T const method(); +}; +template class start<int const>; // instantiation |