]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Add missing scope in typedef diagnostic [PR100763]
authorMatthias Kretz <kretz@kde.org>
Thu, 27 May 2021 15:30:34 +0000 (17:30 +0200)
committerJason Merrill <jason@redhat.com>
Thu, 27 May 2021 21:00:38 +0000 (17:00 -0400)
dump_type on 'const std::string' should not print 'const string' unless
TFF_UNQUALIFIED_NAME is requested.

gcc/cp/ChangeLog:

PR c++/100763
* error.c: Call dump_scope when printing a typedef.

gcc/cp/error.c

index 3d5eebd4bcd196e8a871cc4e1ad5a5af5f3b2c57..ae78b10c7b2e5ab2d6414d28c2c70221f39642bf 100644 (file)
@@ -501,6 +501,8 @@ dump_type (cxx_pretty_printer *pp, tree t, int flags)
       else
        {
          pp_cxx_cv_qualifier_seq (pp, t);
+         if (! (flags & TFF_UNQUALIFIED_NAME))
+           dump_scope (pp, CP_DECL_CONTEXT (decl), flags);
          pp_cxx_tree_identifier (pp, TYPE_IDENTIFIER (t));
          return;
        }