]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: ICE with templated sizeof(E1) / sizeof(E2) [PR114888]
authorPatrick Palka <ppalka@redhat.com>
Tue, 30 Apr 2024 01:14:18 +0000 (21:14 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 30 Apr 2024 01:14:18 +0000 (21:14 -0400)
commit3900e944b0ac9db77380c5bb8635977dfd3b0691
treea3e4f629c412d45b61f82fd78d47746bc5302f29
parent42d2e2f57e943c0f79940729d1ef1945388499de
c++: ICE with templated sizeof(E1) / sizeof(E2) [PR114888]

In the sizeof / sizeof operator expression handling we're missing
a dependence check for the second operand.

PR c++/114888

gcc/cp/ChangeLog:

* typeck.cc (cp_build_binary_op) <case *_DIV_*>: Add missing
dependence check for the second sizeof operand.

gcc/testsuite/ChangeLog:

* g++.dg/template/sizeof19.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/typeck.cc
gcc/testsuite/g++.dg/template/sizeof19.C [new file with mode: 0644]