rjmccall added a comment. In https://reviews.llvm.org/D28148#632541, @Quuxplusone wrote:
> Re the language option: In https://reviews.llvm.org/D27163, @rsmith wrote: > > > Perhaps some catch-all "I want defined behavior for things that C defines > > even though I'm compiling in C++" flag would make sense here? > > It didn't happen then, but I'd like to re-raise the idea. There's probably > plenty of code (e.g. Apple kernel drivers, judging from @rjmccall's comments > on https://reviews.llvm.org/D27163) that's written in the common subset of C > and C++ but compiled as C++. It's unfortunate that that workflow keeps > getting "broken" by aggressive diagnostics (in this case) and aggressive > optimizations (in that case). I'd like if Clang provided a way for the user > to explicitly opt-in and say "Some or all of this code is C compiled as C++; > please respect that." > > (IOW, it looks as if this patch proposes to fix the noisy diagnostic for > every language //except for// C-sometimes-compiled-as-C++, and as a sometime > writer of C-sometimes-compiled-as-C++ myself, that irks me. Apologies if I've > misconstrued the patch.) C++, for all its problems, does fix some things about C. I don't think it makes all that much sense to support a general "this is C being compiled as C++" mode, especially for diagnostics where (generally) compiling things as C++ ends up applying a more sensible language rule than C provides. We tend to have a lot more diagnostics that are basically pointing out flaws in C that C++ fixes than the other way around. https://reviews.llvm.org/D28148 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits