No semantics changes.
gcc/cp/ChangeLog:
* cp-tree.h (extract): Add new overload to return tree.
* parser.cc (cp_parser_asm_string_expression): Use tree extract.
* semantics.cc (cexpr_str::extract): Add new overload to return
tree.
bool type_check (location_t location);
bool extract (location_t location, const char * & msg, int &len);
+ bool extract (location_t location, tree &str);
tree message;
private:
tree message_data = NULL_TREE;
cexpr_str cstr (string);
if (!cstr.type_check (tok->location))
return error_mark_node;
- const char *msg;
- int len;
- if (!cstr.extract (tok->location, msg, len))
+ if (!cstr.extract (tok->location, string))
return error_mark_node;
parens.require_close (parser);
- string = build_string (len, msg);
return string;
}
else if (!cp_parser_is_string_literal (tok))
return true;
}
+/* Extract constant string at LOCATON into output string STR.
+ Returns true if successful, otherwise false. */
+
+bool
+cexpr_str::extract (location_t location, tree &str)
+{
+ const char *msg;
+ int len;
+ if (!extract (location, msg, len))
+ return false;
+ str = build_string (len, msg);
+ return true;
+}
+
/* Extract constant string at LOCATION into output string MSG with LEN.
Returns true if successful, otherwise false. */