]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: -Wmismatched-tags and modules
authorJason Merrill <jason@redhat.com>
Sat, 5 Oct 2024 02:23:04 +0000 (22:23 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 7 Oct 2024 15:55:42 +0000 (11:55 -0400)
In Wmismatched-tags-6.C, we try to compare two declarations of the Cp alias
template, and ICE trying to check whether they're in module purview.  We
need to check DECL_LANG_SPECIFIC like elsewhere in the compiler.

gcc/cp/ChangeLog:

* decl.cc (duplicate_decls): Only check PURVIEW_P if
DECL_LANG_SPECIFIC.

gcc/cp/decl.cc

index 07fb9855cd20b4fbc91fd55b4961abedb7269299..0c5b5c06a12e73e149d0a5446336d12e05687172 100644 (file)
@@ -2530,7 +2530,7 @@ duplicate_decls (tree newdecl, tree olddecl, bool hiding, bool was_hidden)
 
       /* Propagate purviewness and importingness as with
         set_instantiating_module.  */
-      if (modules_p ())
+      if (modules_p () && DECL_LANG_SPECIFIC (new_result))
        {
          if (DECL_MODULE_PURVIEW_P (new_result))
            DECL_MODULE_PURVIEW_P (old_result) = true;