PR c++/90047 - ICE with enable_if alias template.
authorJason Merrill <jason@redhat.com>
Thu, 18 Apr 2019 03:32:24 +0000 (23:32 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 18 Apr 2019 03:32:24 +0000 (23:32 -0400)
commit5a58e967b526eba3d9b850cd7bc76dcc580bf708
tree844ecad256d70dffae00df101a967a92775604d0
parent19caab83ca8b30a1a37ec968aaea8086b096d113
PR c++/90047 - ICE with enable_if alias template.

In order to make alias templates useful for SFINAE we instantiate them under
the prevailing 'complain' argument, so an error encountered while
instantiating during SFINAE context is silent.  The problem in this PR comes
when we later look up the erroneous instantiation and don't give an error at
that point.  Fixed by not adding an erroneous instantiation to the hash
table, so we instantiate it again when needed and get the error.  This
required changes to a number of tests, which previously said "substitution
failed:" with no explanation of what the failure was; now we properly
explain.

* pt.c (tsubst_decl) [TYPE_DECL]: Don't put an erroneous decl in the
hash table when we're in SFINAE context.

From-SVN: r270433
33 files changed:
gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/g++.dg/cpp0x/alias-decl-67.C [new file with mode: 0644]
gcc/testsuite/g++.old-deja/g++.robertl/eb43.C
libstdc++-v3/testsuite/20_util/duration/arithmetic/dr3050.cc
libstdc++-v3/testsuite/20_util/from_chars/1_c++20_neg.cc
libstdc++-v3/testsuite/20_util/from_chars/1_neg.cc
libstdc++-v3/testsuite/20_util/shared_ptr/assign/auto_ptr_neg.cc
libstdc++-v3/testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc
libstdc++-v3/testsuite/20_util/shared_ptr/cons/unique_ptr_neg.cc
libstdc++-v3/testsuite/20_util/to_chars/1_neg.cc
libstdc++-v3/testsuite/20_util/tuple/element_access/get_neg.cc
libstdc++-v3/testsuite/20_util/unique_ptr/cons/ptr_deleter_neg.cc
libstdc++-v3/testsuite/20_util/unique_ptr/modifiers/reset_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/forward_list/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/list/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc
libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/copy_ctor_neg.cc
libstdc++-v3/testsuite/experimental/memory/shared_ptr/cons/pointer_ctor_neg.cc
libstdc++-v3/testsuite/experimental/memory/shared_ptr/modifiers/reset_neg.cc