[Bug c++/71832] [7/8 Regression] ICE on invalid C++11 code with incorrect decltype use for non-type template parameter: Segmentation fault

paolo.carlini at oracle dot com gcc-bugzilla@gcc.gnu.org
Mon Mar 5 16:38:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71832

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paolo.carlini at oracle dot com

--- Comment #5 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Avoiding the ICE seems easy, something like the below but the diagnostic we
produce is way too redundant. I believe that in such cases we should skip
completely the body of the template (A).

Index: class.c
===================================================================
--- class.c     (revision 258250)
+++ class.c     (working copy)
@@ -7568,6 +7568,9 @@ push_nested_class (tree type)
 void
 pop_nested_class (void)
 {
+  if (!current_class_type)
+    return;
+
   tree context = DECL_CONTEXT (TYPE_MAIN_DECL (current_class_type));

   popclass ();


More information about the Gcc-bugs mailing list