summaryrefslogtreecommitdiffstats
path: root/test/input
diff options
context:
space:
mode:
authorMichka Popoff <michkapopoff@gmail.com>2016-12-19 21:55:38 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-01 20:15:48 (GMT)
commit96c650d9f145554cc892eace1a072ed02440fe61 (patch)
tree3d67232042c079da2468236346861ca286ef4c1b /test/input
parente7252f578951cfebb57e7ab122b388404f278bc3 (diff)
downloadCastXML-96c650d9f145554cc892eace1a072ed02440fe61.zip
CastXML-96c650d9f145554cc892eace1a072ed02440fe61.tar.gz
CastXML-96c650d9f145554cc892eace1a072ed02440fe61.tar.bz2
Output: Add support for elaborated type specifiers
Elaborated type specifiers refer to a class, struct, union, or enum name preceded by the corresponding keyword (e.g. `struct foo`). These type specifiers are important for C code, but are also sometimes relevant in the context of C++ code. Add an `ElaboratedType` XML element to the castxml output format to represent elaborated type specifiers. Increment the format *major* version number to indicate the addition of an element that will require clients to be updated.
Diffstat (limited to 'test/input')
-rw-r--r--test/input/Elaborated.cxx49
1 files changed, 49 insertions, 0 deletions
diff --git a/test/input/Elaborated.cxx b/test/input/Elaborated.cxx
new file mode 100644
index 0000000..d77e812
--- /dev/null
+++ b/test/input/Elaborated.cxx
@@ -0,0 +1,49 @@
+namespace start {
+
+ // Struct
+ struct Foo1;
+
+ Foo1 *s1;
+ struct Foo1 *s2; // elaborated
+ const Foo1 *s3;
+ const struct Foo1 *s4; // elaborated
+ typedef Foo1 *s5;
+ typedef struct Foo1 *s6; // elaborated
+
+ // Enum
+ enum Foo2 { };
+
+ Foo2 *e1;
+ enum Foo2 *e2; // elaborated
+ const Foo2 *e3;
+ const enum Foo2 *e4; // elaborated
+ typedef Foo2 *e5;
+ typedef enum Foo2 *e6; // elaborated
+
+ // Union
+ union Foo3 {};
+
+ Foo3 *u1;
+ union Foo3 *u2; // elaborated
+ const Foo3 *u3;
+ const union Foo3 *u4; // elaborated
+ typedef Foo3 *u5;
+ typedef union Foo3 *u6; // elaborated
+
+ // Class
+ class Foo4 {};
+
+ Foo4 *c1;
+ class Foo4 *c2; // elaborated
+ const Foo3 *c3;
+ const class Foo4 *c4; // elaborated
+ typedef Foo4 *c5;
+ typedef class Foo4 *c6; // elaborated
+
+ // Function arguments
+ void func1(Foo1 *a1, struct Foo1 *a2);
+ void func2(Foo2 *a3, enum Foo2 *a4);
+ void func3(Foo3 *a5, union Foo3 *a6);
+ void func4(Foo4 *a7, class Foo4 *a8);
+
+}