aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2019-08-30 14:54:49 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2019-08-30 14:54:49 +0100
commit61f5cb2313f7a3336264eeabbe9fbaccd00e49a0 (patch)
tree53f8e4e427d2ccaad0a38927a6710a48c9bef542 /gcc/ada/gcc-interface/trans.c
parent815b53683243f09194a9a0af270cde060c2d58e7 (diff)
downloadgcc-61f5cb2313f7a3336264eeabbe9fbaccd00e49a0.zip
gcc-61f5cb2313f7a3336264eeabbe9fbaccd00e49a0.tar.gz
gcc-61f5cb2313f7a3336264eeabbe9fbaccd00e49a0.tar.bz2
PR libstdc++/89164 enforce constraints for uninitialized algos
The memmove optimizations for std::uninitialized_copy/fill/_n will compile even if the type is not copy constructible, because std::copy doesn't require copy construction to work. But the uninitialized algorithms do require it. This adds explicit static assertions to ensure we don't allow ill-formed initializations. PR libstdc++/89164 * include/bits/stl_algobase.h (__copy_move): Give descriptive names to template parameters. * include/bits/stl_uninitialized.h (uninitialized_copy) (uninitialized_fill, uninitialized_fill_n): Add static assertions to diagnose invalid uses. * testsuite/20_util/specialized_algorithms/uninitialized_copy/1.cc: Adjust expected error. * testsuite/20_util/specialized_algorithms/uninitialized_copy/89164.cc: New test. * testsuite/20_util/specialized_algorithms/uninitialized_copy_n/ 89164.cc: New test. * testsuite/20_util/specialized_algorithms/uninitialized_fill/89164.cc: New test. * testsuite/20_util/specialized_algorithms/uninitialized_fill_n/ 89164.cc: New test. * testsuite/23_containers/vector/cons/89164.cc: New test. * testsuite/23_containers/vector/cons/89164_c++17.cc: New test. From-SVN: r275177
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
0 files changed, 0 insertions, 0 deletions