summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/variadic-rref.C
blob: 08221b460fe8051212e62191531d9656cdfeaa4e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// { dg-options "-std=c++0x" }
// PR c++/33939
template<typename T>
struct refs_only;

template<typename T>
struct refs_only<T &>
{};

template<typename T>
refs_only<T> foo( T && t)
{
    return refs_only<T>();
}

template<typename... T>
struct va_refs_only;

template<typename T>
struct va_refs_only<T>
  : refs_only<T>
{};

template<typename... T>
va_refs_only<T...> bar( T &&... t)
{
    return va_refs_only<T...>();
}

int main()
{
    int j = 0;
    foo(j);
    bar(j); // error: invalid use of incomplete type 'struct refs_only<int>'
}