aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2006-12-03 18:24:42 -0800
committerAndrew Pinski <pinskia@gcc.gnu.org>2006-12-03 18:24:42 -0800
commitdd90d2b2108acd851e82b45f8510b23b4b3a90b2 (patch)
tree2e4aa196c51f94d752ebcab9cde74543444bda3a /gcc/cp/error.c
parentbd6a088940b915e561699648901bf1e6c5effddd (diff)
downloadgcc-dd90d2b2108acd851e82b45f8510b23b4b3a90b2.zip
gcc-dd90d2b2108acd851e82b45f8510b23b4b3a90b2.tar.gz
gcc-dd90d2b2108acd851e82b45f8510b23b4b3a90b2.tar.bz2
re PR c++/14329 ([4.1 only] badly formatted warnings for SRA replacements used uninitialized)
2006-12-03 Richard Henderson <rth@redhat.com> Andrew Pinski <pinskia@gmail.com> PR C++/14329 * error.c (cp_printer) <'D'>: Handle DECL_DEBUG_EXPR. 2006-12-03 Richard Henderson <rth@redhat.com> Andrew Pinski <pinskia@gmail.com> PR C++/14329 * g++.dg/warn/unit-1.C: New test. Co-Authored-By: Andrew Pinski <pinskia@gmail.com> From-SVN: r119478
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index c4f4d46..49f3367 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2337,7 +2337,22 @@ cp_printer (pretty_printer *pp, text_info *text, const char *spec,
{
case 'A': result = args_to_string (next_tree, verbose); break;
case 'C': result = code_to_string (next_tcode); break;
- case 'D': result = decl_to_string (next_tree, verbose); break;
+ case 'D':
+ {
+ tree temp = next_tree;
+ if (DECL_P (temp)
+ && DECL_DEBUG_EXPR_IS_FROM (temp) && DECL_DEBUG_EXPR (temp))
+ {
+ temp = DECL_DEBUG_EXPR (temp);
+ if (!DECL_P (temp))
+ {
+ result = expr_to_string (temp);
+ break;
+ }
+ }
+ result = decl_to_string (temp, verbose);
+ }
+ break;
case 'E': result = expr_to_string (next_tree); break;
case 'F': result = fndecl_to_string (next_tree, verbose); break;
case 'L': result = language_to_string (next_lang); break;