aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2024-10-22 16:37:49 -0400
committerJason Merrill <jason@redhat.com>2024-10-22 17:56:23 -0400
commit71e13ea134b04562f8f2cdd9c4a55dbb0905f96a (patch)
treea0e869c15fabe7a84ba58ce7cc628ceea6ccaea6 /gcc/cp
parent5c6c1aba338d1e563e3da2c5e255f490f0865994 (diff)
downloadgcc-71e13ea134b04562f8f2cdd9c4a55dbb0905f96a.zip
gcc-71e13ea134b04562f8f2cdd9c4a55dbb0905f96a.tar.gz
gcc-71e13ea134b04562f8f2cdd9c4a55dbb0905f96a.tar.bz2
c++: non-dep structured binding decltype again [PR117107]
The patch for PR92687 handled the usual case of a decomp variable not being in the table, but missed the case of there being nothing in the table yet. PR c++/117107 PR c++/92687 gcc/cp/ChangeLog: * decl.cc (lookup_decomp_type): Handle null table. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/decomp10.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/decl.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/decl.cc b/gcc/cp/decl.cc
index 7281818..354b224 100644
--- a/gcc/cp/decl.cc
+++ b/gcc/cp/decl.cc
@@ -9446,8 +9446,9 @@ static GTY((cache)) decl_tree_cache_map *decomp_type_table;
tree
lookup_decomp_type (tree v)
{
- if (tree *slot = decomp_type_table->get (v))
- return *slot;
+ if (decomp_type_table)
+ if (tree *slot = decomp_type_table->get (v))
+ return *slot;
return NULL_TREE;
}