Bug 68929 - GCC hangs in nested template instantiations even after static_assert fails.
Summary: GCC hangs in nested template instantiations even after static_assert fails.
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, memory-hog
Depends on:
Blocks:
 
Reported: 2015-12-16 00:29 UTC by Eric Fiselier
Modified: 2020-07-22 15:05 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2015-12-16 00:00:00


Attachments
reproducer.cpp (668 bytes, text/plain)
2015-12-16 00:30 UTC, Eric Fiselier
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Fiselier 2015-12-16 00:29:41 UTC
GCC currently hangs when compiling the attached reproducer. The reproducer is a stripped down libc++ test that ensures that  "std::make_integer_sequence<int, -100>" causes a static assertion. 

GCC will emit the assertion but then continue to run and consume more memory until its killed for being OOM.
Comment 1 Eric Fiselier 2015-12-16 00:30:15 UTC
Created attachment 37044 [details]
reproducer.cpp

standalone reproducer
Comment 2 Markus Trippelsdorf 2015-12-16 08:13:50 UTC
All supported gcc versions show this behavior.
Comment 3 Paolo Carlini 2016-05-27 10:01:35 UTC
Seems related to c++/55722
Comment 4 Jonathan Wakely 2020-07-22 15:05:54 UTC
Probably related to PR c++/96286, because if we stopped trying to compile a class after a failed static_assert then we wouldn't keep recursing in Eric's example here.