gcc/testsuite/g++.dg/cpp0x/variadic88.C
raw| 1 | // { dg-do compile { target c++11 } } |
| 2 | |
| 3 | template<template<typename...> class TT> |
| 4 | TT<int, float, double> foo(TT<int, float>) |
| 5 | { |
| 6 | return TT<int, float, double>(); |
| 7 | } |
| 8 | |
| 9 | template<typename T> |
| 10 | int& foo(T) |
| 11 | { |
| 12 | static int i = 0; return i; |
| 13 | } |
| 14 | |
| 15 | template<typename T, typename U> |
| 16 | struct pair {}; |
| 17 | |
| 18 | void bar() |
| 19 | { |
| 20 | pair<int, float> p; |
| 21 | int& i = foo(p); |
| 22 | } |
| 23 |