This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug driver/79882] Lack of bounds checking on -ftemplate-depth argument
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 09 Mar 2017 01:51:22 +0000
- Subject: [Bug driver/79882] Lack of bounds checking on -ftemplate-depth argument
- Auto-submitted: auto-generated
- References: <bug-79882-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79882
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |rejects-valid
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-03-09
CC| |msebor at gcc dot gnu.org
See Also| |https://gcc.gnu.org/bugzill
| |a/show_bug.cgi?id=71905
Ever confirmed|0 |1
Known to fail| |4.1.3, 4.2.2, 4.3.2, 4.6.0,
| |5.3.0, 6.3.0, 7.0
--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed. GCC uses an int to represent numeric option arguments. See also
bug 71905 for other (arguably more serious) manifestations of the same problem.
$ cat t.C && gcc -S -Wall -Wextra -Wpedantic -ftemplate-depth=4294967296 t.C
template <int N>
void f () { f<N - 1>(); }
template void f<123>();
t.C:4:22: fatal error: template instantiation depth exceeds maximum of 0 (use
-ftemplate-depth= to increase the maximum)
template void f<123>();
^
compilation terminated.