[cfe-dev] RFC: Clang driver redesign

Jean-Daniel Dupas devlists at shadowlab.org
Tue Nov 8 10:10:51 PST 2011


Le 8 nov. 2011 à 18:16, David Chisnall a écrit :

> On 8 Nov 2011, at 16:50, Jean-Daniel Dupas wrote:
> 
>> As previously suggested in this discussion, I think it could be even better if clang can decide if it uses C or C++ mode not only based on the driver name, but also based on the compiled file language.
>> 
>> clang -o hello hello.cpp
>> 
>> should not result in nasty linker errors as it already knows it is compiling c++.
> 
> You'll still encounter problems if you do:
> 
> clang -c hello.cpp
> clang -o hello hello.o
> 
> Which is what even a trivial Makefile of the form that students are usually expected to submit in their first C or C++ assignment will do if you use clang instead of clang++ for linking.  With your suggestion, it actually becomes worse, because now clang does work for linking C++ in some cases, but not in others.  

Good point. This inconsistency may be worse than the linking error.

> David

-- Jean-Daniel








More information about the cfe-dev mailing list