diff --git a/src/fpm_compile_commands.F90 b/src/fpm_compile_commands.F90
index d085204447..826250aa30 100644
--- a/src/fpm_compile_commands.F90
+++ b/src/fpm_compile_commands.F90
@@ -55,8 +55,34 @@ module fpm_compile_commands
         
     end type compile_command_table_t    
     
+    interface compile_command_t
+        module procedure cct_new
+    end interface compile_command_t
+    
     contains
     
+    !> Override default initializer (GCC 15 bug)
+    type(compile_command_t) function cct_new(directory,arguments,file) result(cct)
+        character(len=*), intent(in) :: directory,file
+        character(len=*), optional, intent(in) :: arguments(:)
+        
+        integer :: i,n
+        
+        cct%directory = string_t(trim(directory))
+        cct%file = string_t(trim(file))
+        
+        if (present(arguments)) then 
+           n = size(arguments)
+        else
+           n = 0
+        endif
+        allocate(cct%arguments(n))
+        do i=1,n
+            cct%arguments(i) = string_t(trim(arguments(i)))
+        end do
+        
+    end function cct_new  
+      
     !> Cleanup compile command
     elemental subroutine compile_command_destroy(self)
     
@@ -281,10 +307,9 @@ subroutine cct_register(self, command, target_os, error)
         ! Fallback: use last argument if not found
         if (len_trim(source_file)==0) source_file = trim(args(n))
 
-        ! Fill in the compile_command_t
-        cmd = compile_command_t(directory = string_t(cwd), &
-                                arguments = [(string_t(trim(args(i))), i=1,n)], &
-                                file = string_t(source_file))
+        ! Fill in the compile_command_t. 
+        ! Use non-default initializer due to gcc 15 bug
+        cmd = compile_command_t(cwd, args, source_file)
         
         ! Add it to the structure
         !$omp critical (command_update)
