aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-ast-full-test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/ast/rust-ast-full-test.cc')
-rw-r--r--gcc/rust/ast/rust-ast-full-test.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/rust/ast/rust-ast-full-test.cc b/gcc/rust/ast/rust-ast-full-test.cc
index 53007e7..aa17d60 100644
--- a/gcc/rust/ast/rust-ast-full-test.cc
+++ b/gcc/rust/ast/rust-ast-full-test.cc
@@ -5359,8 +5359,12 @@ Attribute::check_cfg_predicate (const Session &session) const
/* assume that cfg predicate actually can exist, i.e. attribute has cfg or
* cfg_attr path */
if (!has_attr_input ()
- || (path.as_string () != "cfg" && path.as_string () != "cfg_attr"))
+ || (path.as_string () != "cfg" && path.as_string () != "cfg_attr")) {
+ // DEBUG message
+ fprintf (stderr, "tried to check cfg predicate on attr that either has no input or invalid path. attr: '%s'\n", as_string ().c_str ());
+
return false;
+ }
// assume that it has already been parsed
if (!is_parsed_to_meta_item ())