This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug driver/79882] Lack of bounds checking on -ftemplate-depth argument


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]