]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: address of class NTTP object as targ [PR113242]
authorPatrick Palka <ppalka@redhat.com>
Wed, 17 Jan 2024 18:01:01 +0000 (13:01 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 18 Jan 2024 15:53:15 +0000 (10:53 -0500)
commit4ffb23975b32bfd285915c3d6659b837868b5aa9
treeed9eb7c41dc29cc203bfe163cf0fef940104b7f9
parentb4af3ed9a75135b8e3e5d57b4d1e2adaec52e8fc
c++: address of class NTTP object as targ [PR113242]

invalid_tparm_referent_p was rejecting using the address of a class NTTP
object as a template argument, but this should be fine.

PR c++/113242
PR c++/99493

gcc/cp/ChangeLog:

* pt.cc (invalid_tparm_referent_p) <case ADDR_EXPR>: Suppress
DECL_ARTIFICIAL rejection test for class NTTP objects.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/nontype-class61.C: New test.
* g++.dg/cpp2a/nontype-class62.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit 68cea2d32a9fd525154b6a48042e5835d4c5e371)
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp2a/nontype-class61.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/nontype-class62.C [new file with mode: 0644]