@@ -73,10 +73,19 @@
header, but expanded in a non-system file. */
#define in_system_header_at(LOC) \
(linemap_location_in_system_header_p (line_table, LOC))
-/* Return a positive value if LOCATION is the locus of a token that
- comes from a macro expansion, O otherwise. */
-#define from_macro_expansion_at(LOC) \
- ((linemap_location_from_macro_expansion_p (line_table, LOC)))
+/* Return TRUE if LOCATION is the locus of a token that
+ comes from a macro expansion, FALSE otherwise. */
+static inline bool
+from_macro_expansion_at (location_t loc)
+{
+ /* Resolve to the spelling location so we return false for arguments to a
+ macro. */
+ return linemap_location_from_macro_expansion_p (line_table, loc)
+ && linemap_resolve_location (line_table, loc,
+ LRK_MACRO_DEFINITION_LOCATION, NULL)
+ == linemap_resolve_location (line_table, loc,
+ LRK_SPELLING_LOCATION, NULL);
+}
static inline location_t
get_pure_location (location_t loc)