[PATCH] Fix PR52682

Richard Guenther rguenther@suse.de
Fri Mar 23 08:16:00 GMT 2012


Committed as obvious.

Richard.

2012-03-23  William Bader  <williambader@hotmail.com>

	c-family/
	* c-lex.c (c_lex_with_flags): Avoid declarations after stmts.

Index: gcc/c-family/c-lex.c
===================================================================
*** gcc/c-family/c-lex.c	(revision 185724)
--- gcc/c-family/c-lex.c	(working copy)
*************** c_lex_with_flags (tree *value, location_
*** 342,347 ****
--- 342,349 ----
  
  	if (flags & CPP_N_USERDEF)
  	  {
+ 	    char *str;
+ 	    tree literal;
  	    tree suffix_id = get_identifier (suffix);
  	    int len = tok->val.str.len - strlen (suffix);
  	    /* If this is going to be used as a C string to pass to a
*************** c_lex_with_flags (tree *value, location_
*** 350,358 ****
  					    (const char *) tok->val.str.text);
  	    TREE_TYPE (num_string) = char_array_type_node;
  	    num_string = fix_string_type (num_string);
! 	    char *str = CONST_CAST (char *, TREE_STRING_POINTER (num_string));
  	    str[len] = '\0';
! 	    tree literal = build_userdef_literal (suffix_id, *value,
  						  num_string);
  	    *value = literal;
  	  }
--- 352,360 ----
  					    (const char *) tok->val.str.text);
  	    TREE_TYPE (num_string) = char_array_type_node;
  	    num_string = fix_string_type (num_string);
! 	    str = CONST_CAST (char *, TREE_STRING_POINTER (num_string));
  	    str[len] = '\0';
! 	    literal = build_userdef_literal (suffix_id, *value,
  						  num_string);
  	    *value = literal;
  	  }



More information about the Gcc-patches mailing list