https://gcc.gnu.org/g:71a9e21fe565f1149b8646a18c642bd87e6c37c1

commit r16-6996-g71a9e21fe565f1149b8646a18c642bd87e6c37c1
Author: Marek Polacek <[email protected]>
Date:   Thu Jan 22 16:42:10 2026 -0500

    c++/reflection: use build_stub_type
    
    A little cleanup as suggested in
    <https://gcc.gnu.org/pipermail/gcc-patches/2025-December/704168.html>.
    
    gcc/cp/ChangeLog:
    
            * tree.cc (handle_annotation_attribute): Use build_stub_type.
    
    Reviewed-by: Jakub Jelinek <[email protected]>

Diff:
---
 gcc/cp/tree.cc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/cp/tree.cc b/gcc/cp/tree.cc
index b6550a2f0489..bb00fff4a772 100644
--- a/gcc/cp/tree.cc
+++ b/gcc/cp/tree.cc
@@ -5956,11 +5956,9 @@ handle_annotation_attribute (tree *node, tree ARG_UNUSED 
(name),
        {
          tree arg = make_tree_vec (1);
          tree type = TREE_TYPE (TREE_VALUE (args));
-         tree ctype
-           = cp_build_qualified_type (type, cp_type_quals (type)
-                                            | TYPE_QUAL_CONST);
          TREE_VEC_ELT (arg, 0)
-           = cp_build_reference_type (ctype, /*rval=*/false);
+           = build_stub_type (type, cp_type_quals (type) | TYPE_QUAL_CONST,
+                              /*rvalue=*/false);
          if (!is_xible (INIT_EXPR, type, arg))
            {
              auto_diagnostic_group d;

Reply via email to