c++: -Waddress and value-dependent expr [PR105885]
authorJason Merrill <jason@redhat.com>
Thu, 23 Jun 2022 03:50:23 +0000 (23:50 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 23 Jun 2022 15:45:27 +0000 (11:45 -0400)
commitb96b64bec37c3dddf1f0f93c27ceb4fd5685c70a
tree76db0644a37daa6cec96e14cff12729f5308f575
parentc600ff8dc5a870d952c9c63fe4fa4535b9f0a488
c++: -Waddress and value-dependent expr [PR105885]

We already suppress various warnings for code that would be tautological if
written directly, but not when it's the result of template substitution.  It
seems we need to do this for -Waddress as well.

PR c++/105885

gcc/cp/ChangeLog:

* pt.cc (tsubst_copy_and_build): Also suppress -Waddress for
comparison of dependent operands.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1z/constexpr-if37.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp1z/constexpr-if37.C [new file with mode: 0644]