title: Visual Studio Code: how to add arguments for g++ compiler?
body: <p>I want to use some C++17 features that Mac's clang doesn't currently support, so I use</p>
  
  <pre><code>brew install gcc --HEAD
  </code></pre>
  
  <p>to install the g++ 10.0.1 version. Codes run well in terminal by directly calling</p>
  
  <pre><code>g++-HEAD -std=c++17 test.cpp
  </code></pre>
  
  <p>I also created a link <code>ln -s g++-HEAD g++</code> in bash, and added an alias <code>alias g++='g++ -std=c++17'</code> in <code>.bash_profile</code>, so that</p>
  
  <pre><code>g++ test.cpp
  </code></pre>
  
  <p>will do the same job.</p>
  
  <p>I want to run C++ code in Visual Studio Code - Mac version. After installing its C/C++ Extension by Microsoft, and Code Runner Extension, I set up the <code>settings.json</code> file in VSCode to include compiler argument:</p>
  
  <pre><code>{
      "C_Cpp.default.cppStandard": "c++17",
      "C_Cpp.default.compilerPath": "/usr/bin/g++",
      "C_Cpp.default.intelliSenseMode": "gcc-x64",
      "C_Cpp.default.compilerArgs": [
          "-std=c++17"
      ]
  }
  </code></pre>
  
  <p>Then I tried to run the same code. However, I got warning:</p>
  
  <pre><code>[Running] cd "/some directory/" &amp;&amp; g++ test.cpp -o test &amp;&amp; "/some directory/"test
  warning: fold-expressions only available with '-std=c++17' or '-std=gnu++17'
  </code></pre>
  
  <p>Clearly, it means the g++ compiler ran in VSCode is not the one I manually set with alias. More interestingly, if I run directly in VSCode TERMINAL, my previous code</p>
  
  <pre><code>g++ test.cpp -o test
  </code></pre>
  
  <p>works. </p>
  
  <p>I'm confused by the setup in VSCode: why doesn't the runner use the same <code>g++</code> compiler argument as used in VSCode's own terminal? Also, how should I modify the <code>settings.json</code> file or some other files in VSCode so that I can correctly add the <code>-std=c++17</code> argument?</p>