1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 00:45:28 +02:00

Test case for bug 309564.

This commit is contained in:
Sergey Prigogin 2010-04-18 00:50:34 +00:00
parent a67b587f77
commit a92398bdf6

View file

@ -2276,7 +2276,20 @@ public class AST2TemplateTests extends AST2BaseTest {
parseAndCheckBindings(code);
}
// template<typename T, typename U>
// T f(U* f) {}
//
// template<typename T, typename U>
// T f(U& f) {}
//
// void test(int* x) {
// f<int>(x);
// }
public void _testFunctionTemplate_309564() throws Exception {
final String code = getAboveComment();
parseAndCheckBindings(code);
}
// template<class U> void f1(void(*f)(const U&)) {}
// void f2(const int& b){}
// void test() {
@ -4713,7 +4726,7 @@ public class AST2TemplateTests extends AST2BaseTest {
// template<typename... Types> void f(Types... rest);
// template<typename... Types> void g(Types... rest) {
// f(&rest...); // &rest... is a pack expansion, &rest is its pattern
// f(&rest...); // &rest... is a pack expansion, &rest is its pattern
// }
public void testVariadicTemplateExamples_280909r() throws Exception {
final String code= getAboveComment();
@ -4735,10 +4748,10 @@ public class AST2TemplateTests extends AST2BaseTest {
// template<typename... Args> void f(Args... args) {}
// template<typename... Args> void h(Args... args) {}
// template<typename... Args> void g(Args... args) {
// f(const_cast<const Args*>(&args)...); // okay: Args and args are expanded
// f(const_cast<const Args*>(&args)...); // okay: Args and args are expanded
// f(5 ...); // error: pattern does not contain any parameter packs
// f(args); // error: parameter pack args is not expanded
// f(h(args...) + args...); // okay: first args expanded within h, second args expanded within f.
// f(args); // error: parameter pack args is not expanded
// f(h(args...) + args...); // okay: first args expanded within h, second args expanded within f.
// }
public void testVariadicTemplateExamples_280909s() throws Exception {
final String code= getAboveComment();