[cfe-dev] RFC: Clang driver redesign

Seth Cantrell seth.cantrell at gmail.com
Tue Nov 8 16:19:26 PST 2011


Would the cost of always linking to the standard c++ library, unless asked not to, be too much?

On Nov 8, 2011, at 1:10 PM, Jean-Daniel Dupas wrote:

> 
> 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
> 
> 
> 
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list