about summary refs log tree commit diff
path: root/Completion
diff options
context:
space:
mode:
authordana <dana@dana.is>2020-01-08 17:54:46 -0600
committerdana <dana@dana.is>2020-01-08 17:54:46 -0600
commit4858e868dcf809016a1cb5680327d66d551353ae (patch)
tree6840bb51248dcb91ce98f08a82ad8d2e5ebf1cc9 /Completion
parent379d7088d691bf6413d6c75d44ba922c6185ecb4 (diff)
downloadzsh-4858e868dcf809016a1cb5680327d66d551353ae.tar.gz
zsh-4858e868dcf809016a1cb5680327d66d551353ae.tar.xz
zsh-4858e868dcf809016a1cb5680327d66d551353ae.zip
45261: _gcc: Detect clang-as-gcc
Diffstat (limited to 'Completion')
-rw-r--r--Completion/Unix/Command/_gcc5
1 files changed, 5 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_gcc b/Completion/Unix/Command/_gcc
index bbfbc2b9e..9ec09200e 100644
--- a/Completion/Unix/Command/_gcc
+++ b/Completion/Unix/Command/_gcc
@@ -13,6 +13,11 @@ if [[ "$service" = -value-* ]]; then
     args2=()
   fi
 else
+  # On some systems (macOS), cc/gcc/g++ are actually clang; treat them accordingly
+  [[ $service != clang* ]] &&
+  _pick_variant clang=clang unix --version &&
+  service=clang-$service
+
   args2=( '*:input file:_files -g "*.([cCmisSoak]|cc|cpp|cxx|ii|k[ih])(-.)"' )
 fi