<div dir="ltr">Hi,<div><br></div><div>commit 170edf25 "Improve GCC compatibility by adding stubs for some builtins" fixed bug 354311 by adding stubbed version of gcc builtins.<br></div><div><br></div><div>Besides the caveats already mentioned in the commit this fix has two more:</div><div>1) it depends on specific gcc version, if new gcc introduces new builtins we will have to modify our stubbed version accordingly</div><div>2) it breaks code completion since now clang proposes all the __builin_* symbols as candidates</div><div><br></div><div>With the last issue being very annoying, I think current solution is not the right way to solve the original problem.</div><div><br></div><div>In my opinion the proper fix would be to pass the same options to parser as one would use when compiling a project with clang but libstdc++ library.</div><div>I.e. all the include directories, compilation options and preprocessor definitions should be fetched from:</div><div>clang++ -stdlib=libstdc++ -dM -E - < /dev/null</div><div>instead of from g++!</div><div><br></div><div>Considering we officially support 3 compilers my proposal is:</div><div>If selected compiler is</div><div>1) GCC -> take options from "clang++ -stdlib=libstdc++ -dM -E - < /dev/null"</div><div>2) clang -> take options from "clang++ -stdlib=libc++ -dM -E - < /dev/null" by default or use user's -stdlib option</div><div>3) MSVC -> take options from cl.exe (as currently)</div><div><br></div><div><br></div><div>What do you think?</div><div><br></div><div>Regards,</div><div>Maciej Cencora</div></div>