>  
> +  hash_map (const hash_map &h, bool ggc = false,
> +         bool gather_mem_stats = true CXX_MEM_STAT_INFO)

sorry about the late response, but wouldn't it be better to make this
and the hash_table constructor explicit?  Its probably less important
than other constructors, but is there a reasonable use for taking or
return them by value?

Trev


> +    : m_table (h.m_table, ggc, gather_mem_stats,
> +            HASH_MAP_ORIGIN PASS_MEM_STAT) {}
> +
>    /* Create a hash_map in ggc memory.  */
>    static hash_map *create_ggc (size_t size, bool gather_mem_stats = true
>                              CXX_MEM_STAT_INFO)
> diff --git a/gcc/hash-table.h b/gcc/hash-table.h
> index 192be30..d172841 100644
> --- a/gcc/hash-table.h
> +++ b/gcc/hash-table.h
> @@ -364,6 +364,10 @@ public:
>    explicit hash_table (size_t, bool ggc = false, bool gather_mem_stats = 
> true,
>                      mem_alloc_origin origin = HASH_TABLE_ORIGIN
>                      CXX_MEM_STAT_INFO);
> +  hash_table (const hash_table &, bool ggc = false,
> +           bool gather_mem_stats = true,
> +           mem_alloc_origin origin = HASH_TABLE_ORIGIN
> +           CXX_MEM_STAT_INFO);
>    ~hash_table ();
>  
>    /* Create a hash_table in gc memory.  */
> @@ -580,6 +584,27 @@ hash_table<Descriptor, Allocator>::hash_table (size_t 
> size, bool ggc, bool
>  }
>  
>  template<typename Descriptor, template<typename Type> class Allocator>
> +hash_table<Descriptor, Allocator>::hash_table (const hash_table &h, bool ggc,
> +                                            bool gather_mem_stats,
> +                                            mem_alloc_origin origin
> +                                            MEM_STAT_DECL) :
> +    m_n_elements (h.m_n_elements), m_n_deleted (h.m_n_deleted),
> +    m_searches (0), m_collisions (0),
> +    m_ggc (ggc), m_gather_mem_stats (gather_mem_stats)
> +{
> +  size_t size = h.m_size;
> +
> +  if (m_gather_mem_stats)
> +    hash_table_usage.register_descriptor (this, origin, ggc
> +                                       FINAL_PASS_MEM_STAT);
> +
> +  m_entries = alloc_entries (size PASS_MEM_STAT);
> +  memcpy (m_entries, h.m_entries, size * sizeof (value_type));
> +  m_size = size;
> +  m_size_prime_index = h.m_size_prime_index;
> +}
> +
> +template<typename Descriptor, template<typename Type> class Allocator>
>  hash_table<Descriptor, Allocator>::~hash_table ()
>  {
>    for (size_t i = m_size - 1; i < m_size; i--)
> diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic3.C 
> b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic3.C
> new file mode 100644
> index 0000000..76b6b3f
> --- /dev/null
> +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-variadic3.C
> @@ -0,0 +1,9 @@
> +// PR c++/68309
> +// { dg-do compile { target c++11 } }
> +
> +template <class... Ts> void f(Ts...);
> +template <class T> T g(T);
> +template <typename... Ts> void print(Ts... args) {
> +  [&] { f(g<decltype(args)>(args)...); }();
> +}
> +int main() { print(5.2); }

Reply via email to