martong marked 2 inline comments as done.
martong added inline comments.

================
Comment at: lib/CrossTU/CrossTranslationUnit.cpp:255
+  // in the other unit it has none.
+  if (LangTo.CPlusPlus11 != LangFrom.CPlusPlus11 ||
+      LangTo.CPlusPlus14 != LangFrom.CPlusPlus14 ||
----------------
r.stahl wrote:
> This is likely to become a bug in the future, but I didn't see a better way 
> to compare dialects.
> 
> Is there a way to add a test that lights up once there is a new dialect?
> 
> Would it be too pessimistic to compare the entire LangOpts? Some stuff in 
> there should even still produce errors, right? For example "GnuMode". I 
> skimmed over them and didn't find an obvious one that would differ between 
> translation units of the same project. Maybe the template depth could be set 
> selectively, but to fix that we could mask "COMPATIBLE_" and "BENIGN_" opts.
> This is likely to become a bug in the future, but I didn't see a better way 
> to compare dialects.
> Is there a way to add a test that lights up once there is a new dialect?

`LANGOPTS` are defined as bitfields: `#define LANGOPT(Name, Bits, Default, 
Description) unsigned Name : Bits;`
I can't think of any solution to avoid the future bug, because there is no way 
to enumerate all the C++ dialects.
I am going to ask around about this on cfe-dev, maybe somebody will have an 
idea.

> Would it be too pessimistic to compare the entire LangOpts?
I think that would be too pessimistic.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57906/new/

https://reviews.llvm.org/D57906



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to