[Bug preprocessor/96940] ICE in linemap_compare_locations, at libcpp/line-map.c:1359
jan.smets at nokia dot com
gcc-bugzilla@gcc.gnu.org
Fri Sep 4 19:42:11 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96940
--- Comment #2 from Jan Smets <jan.smets at nokia dot com> ---
This is the workaround I currently have. It avoids calling min_location().
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 90111e4c786..f49019e81d0 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -11005,8 +11005,11 @@ grokdeclarator (const cp_declarator *declarator,
if (initialized > 1)
funcdef_flag = true;
- location_t typespec_loc = smallest_type_location (type_quals,
+ location_t typespec_loc = smallest_type_quals_location (type_quals,
declspecs->locations);
+ // using smallest_type_quals_location() iso. smallest_type_quals_location()
+ // basically removes the usage of min_location on the result of
smallest_type_quals_location().
+ // typespec_loc = min_location (typespec_loc,
declspecs->locations[ds_type_spec]);
if (typespec_loc == UNKNOWN_LOCATION)
typespec_loc = input_location;
More information about the Gcc-bugs
mailing list