Created
November 19, 2015 03:39
-
-
Save CaseyCarter/a59628a17c07e72436fb to your computer and use it in GitHub Desktop.
Ranges TS iterator sentinel hack for GCC trunk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Index: gcc/cp/parser.c | |
| =================================================================== | |
| --- gcc/cp/parser.c (revision 230588) | |
| +++ gcc/cp/parser.c (working copy) | |
| @@ -10963,7 +10963,7 @@ | |
| LOOKUP_ONLYCONVERTING); | |
| end = build_decl (input_location, VAR_DECL, | |
| - get_identifier ("__for_end"), iter_type); | |
| + get_identifier ("__for_end"), cv_unqualified (TREE_TYPE (end_expr))); // CMCHACK: iter_type); | |
| TREE_USED (end) = 1; | |
| DECL_ARTIFICIAL (end) = 1; | |
| pushdecl (end); | |
| @@ -11096,10 +11096,12 @@ | |
| tree iter_type = cv_unqualified (TREE_TYPE (*begin)); | |
| /* The unqualified type of the __begin and __end temporaries should | |
| be the same, as required by the multiple auto declaration. */ | |
| +#if 0 // CMCHACKHACK | |
| if (!same_type_p (iter_type, cv_unqualified (TREE_TYPE (*end)))) | |
| error ("inconsistent begin/end types in range-based %<for%> " | |
| "statement: %qT and %qT", | |
| TREE_TYPE (*begin), TREE_TYPE (*end)); | |
| +#endif | |
| return iter_type; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This patch text is presumably short enough for "fair use" to apply, but I'm no lawyer. So here's the license header from parser.c: