]> 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>
Wed, 17 Jan 2024 18:01:01 +0000 (13:01 -0500)
commit68cea2d32a9fd525154b6a48042e5835d4c5e371
tree1b7db769a2c867bc8e4d417e49ad089a423724b6
parent6eca0d23b7ea84f1d41057bcc9f71d8e0d2d2fe3
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>
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]