I try compile reflection test code with std module without
-freflection but build std module with -freflection. An ICE
accur when I do this.
With debug, the std::meta::info cannot find original type (this
is a builtin type with -freflection), so add a DECL_ORIGINAL_TYPE
check.

gcc/cp/ChangeLog:
        * module.cc(trees_in::decl_value): handle typedef
        with DECL_ORIGINAL_TYPE check
---
 gcc/cp/module.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/cp/module.cc b/gcc/cp/module.cc
index 02e53ef3969..04d9c62bc6e 100644
--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -8959,7 +8959,7 @@ trees_in::decl_value ()
          back_refs[~tag] = decl;
        }
 
-      if (is_typedef)
+      if (is_typedef && DECL_ORIGINAL_TYPE (inner))
        {
          /* Frob it to be ready for cloning.  */
          TREE_TYPE (inner) = DECL_ORIGINAL_TYPE (inner);
-- 
2.53.0

Reply via email to