diff options
author | Brad King <brad.king@kitware.com> | 2016-04-11 19:20:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-04-11 20:18:36 (GMT) |
commit | 816a57ad63f18b8770291a44ca5b9981037195d7 (patch) | |
tree | 8d383bc323d8a2940daed5b9d542a5d21f6e64c7 /test/input | |
parent | 2edc188fd48a6a8467610d9d559985c4893c879a (diff) | |
download | CastXML-816a57ad63f18b8770291a44ca5b9981037195d7.zip CastXML-816a57ad63f18b8770291a44ca5b9981037195d7.tar.gz CastXML-816a57ad63f18b8770291a44ca5b9981037195d7.tar.bz2 |
test: Add case for implicit members of a const aggregate struct
A struct like
struct foo {
int const bar;
};
cannot have an implicit default constructor but can be initialized
as an aggregate, e.g.
foo f = {123};
Clang in C++11 mode and above correctly deletes the implicit default
constructor. Add a test case covering this for C++11 and C++14.
Unfortunately Clang in C++98 mode does not mark the implicit default
constructor as invalid even after `Sema::MarkFunctionReferenced` has
been called. Therefore CastXML incorrectly generates the member.
Add a "broken" test case to record this limitation.
GitHub-Issue: CastXML/CastXML#55
Diffstat (limited to 'test/input')
-rw-r--r-- | test/input/Class-implicit-member-const-aggregate.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/input/Class-implicit-member-const-aggregate.cxx b/test/input/Class-implicit-member-const-aggregate.cxx new file mode 100644 index 0000000..76fc8a8 --- /dev/null +++ b/test/input/Class-implicit-member-const-aggregate.cxx @@ -0,0 +1,3 @@ +struct start { + int const data; +}; |