aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.cc
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2022-09-29 16:27:30 -0400
committerPatrick Palka <ppalka@redhat.com>2022-09-29 16:27:30 -0400
commitc2ee70f20de8133a88553270073226b0f3f55f62 (patch)
treee1766651c58ad168f649c81630633e992277759e /gcc/cp/pt.cc
parent04d54b70fe2c3d69eb1d08f7212f01c8a972b701 (diff)
downloadgcc-c2ee70f20de8133a88553270073226b0f3f55f62.zip
gcc-c2ee70f20de8133a88553270073226b0f3f55f62.tar.gz
gcc-c2ee70f20de8133a88553270073226b0f3f55f62.tar.bz2
c++: implicit lookup of std::initializer_list [PR102576]
Here the lookup for the implicit use of std::initializer_list fails because we do it using get_namespace_binding, which isn't import aware. Fix this by using lookup_qualified_name instead. PR c++/102576 gcc/cp/ChangeLog: * pt.cc (listify): Use lookup_qualified_name instead of get_namespace_binding. gcc/testsuite/ChangeLog: * g++.dg/modules/pr102576_a.H: New test. * g++.dg/modules/pr102576_b.C: New test.
Diffstat (limited to 'gcc/cp/pt.cc')
-rw-r--r--gcc/cp/pt.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index 0f92374..258f76d 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -29161,9 +29161,10 @@ finish_concept_definition (cp_expr id, tree init)
static tree
listify (tree arg)
{
- tree std_init_list = get_namespace_binding (std_node, init_list_identifier);
+ tree std_init_list = lookup_qualified_name (std_node, init_list_identifier);
- if (!std_init_list || !DECL_CLASS_TEMPLATE_P (std_init_list))
+ if (std_init_list == error_mark_node
+ || !DECL_CLASS_TEMPLATE_P (std_init_list))
{
gcc_rich_location richloc (input_location);
maybe_add_include_fixit (&richloc, "<initializer_list>", false);