summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChristian Kamm <kamm@incasoftware.de>2012-09-19 10:09:55 +0200
committerhjk <qthjk@ovi.com>2012-09-19 12:20:58 +0200
commit2aa27e6d22757976811ac9f29291bb12e8871f0a (patch)
treeeb6f963fcb3c179d4f3f226c5db22654daf803e4 /tests
parent0c3acb80c8c72bb24131272060afad114e33d0a1 (diff)
downloadqt-creator-2aa27e6d22757976811ac9f29291bb12e8871f0a.tar.gz
C++11: Make expression-list expand to initializer-list.
This will fix a couple more places where brace-init-lists and pack expansions are allowed but are not currently accepted by the parser. For example: foo(abc...); now parses correctly. Change-Id: I93710cef35154fea8437329f3174e4a2d56637b8 Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/cplusplus/cxx11/data/packExpansion.1.cpp4
-rw-r--r--tests/auto/cplusplus/cxx11/tst_cxx11.cpp1
2 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/cplusplus/cxx11/data/packExpansion.1.cpp b/tests/auto/cplusplus/cxx11/data/packExpansion.1.cpp
new file mode 100644
index 0000000000..eca6796e38
--- /dev/null
+++ b/tests/auto/cplusplus/cxx11/data/packExpansion.1.cpp
@@ -0,0 +1,4 @@
+template <class ... Args>
+int foo(Args args...) {
+ bar(args..., {args...}, e, f);
+}
diff --git a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp
index 3566c11a3e..09a1632115 100644
--- a/tests/auto/cplusplus/cxx11/tst_cxx11.cpp
+++ b/tests/auto/cplusplus/cxx11/tst_cxx11.cpp
@@ -145,6 +145,7 @@ void tst_cxx11::parse_data()
QTest::newRow("aliasDecl.1") << "aliasDecl.1.cpp" << "";
QTest::newRow("enums.1") << "enums.1.cpp" << "";
QTest::newRow("templateGreaterGreater.1") << "templateGreaterGreater.1.cpp" << "";
+ QTest::newRow("packExpansion.1") << "packExpansion.1.cpp" << "";
}
void tst_cxx11::parse()