OSDN Git Service

Add ability to force lexed tokens' source_locations.
[pf3gnuchains/gcc-fork.git] / gcc / fortran / cpp.c
index a40442e..9368d89 100644 (file)
@@ -565,9 +565,17 @@ gfc_cpp_init (void)
   if (gfc_option.flag_preprocessed)
     return;
 
-  cpp_change_file (cpp_in, LC_RENAME, _("<built-in>"));
   if (!gfc_cpp_option.no_predefined)
-    cpp_define_builtins (cpp_in);
+    {
+      /* Make sure all of the builtins about to be declared have
+       BUILTINS_LOCATION has their source_location.  */
+      source_location builtins_loc = BUILTINS_LOCATION;
+      cpp_force_token_locations (cpp_in, &builtins_loc);
+
+      cpp_define_builtins (cpp_in);
+
+      cpp_stop_forcing_token_locations (cpp_in);
+    }
 
   /* Handle deferred options from command-line.  */
   cpp_change_file (cpp_in, LC_RENAME, _("<command-line>"));