150477Speter// Copyright (C) 2013-2015 Free Software Foundation, Inc.
226238Swpaul//
3156813Sru// This file is part of the GNU ISO C++ Library.  This library is free
4156813Sru// software; you can redistribute it and/or modify it under the
580628Sbde// terms of the GNU General Public License as published by the
687204Smarkm// Free Software Foundation; either version 3, or (at your option)
7156813Sru// any later version.
895632Smarkm
9137675Sbz// This library is distributed in the hope that it will be useful,
1080628Sbde// but WITHOUT ANY WARRANTY; without even the implied warranty of
1180628Sbde// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1280530Sdd// GNU General Public License for more details.
1326238Swpaul
1426238Swpaul// You should have received a copy of the GNU General Public License along
15// with this library; see the file COPYING3.  If not see
16// <http://www.gnu.org/licenses/>.
17
18// 20.7.12 specialized algorithms
19
20// { dg-options "-std=gnu++11" }
21// { dg-do compile }
22
23#include <memory>
24
25// libstdc++/58982
26
27// trivial class that is not assignable
28struct T
29{
30  T() = default;
31  ~T() = default;
32
33  T& operator=(const T&) = delete;
34};
35
36void
37test01(T* first)
38{
39  T t;
40  std::uninitialized_fill_n(first, 1, t);
41}
42