diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index 761700b17c..7f95f25b83 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -2,8 +2,8 @@ # @private module CompilerConstants - GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9].freeze - GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9])$/.freeze + GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9 10].freeze + GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9]|10)$/.freeze COMPILER_SYMBOL_MAP = { "gcc" => :gcc, "clang" => :clang, diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index aed19cc8d7..456a156871 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -78,7 +78,7 @@ class DevelopmentTools path = HOMEBREW_PREFIX/"opt/gcc/bin"/cc path = locate(cc) unless path.exist? version = if path && - build_version = `#{path} --version`[/gcc(?:(?:-\d(?:\.\d)?)? \(.+\))? (\d\.\d\.\d)/, 1] + build_version = `#{path} --version`[/gcc(?:(?:-\d(?:\.\d)?)? \(.+\))? (\d+\.\d\.\d)/, 1] Version.new build_version else Version::NULL