nickdesaulniers added inline comments.

================
Comment at: lib/Sema/SemaType.cpp:1682
     // or via one or more typedefs."
-    if (!S.getLangOpts().C99 && !S.getLangOpts().CPlusPlus
-        && TypeQuals & Result.getCVRQualifiers()) {
----------------
srhines wrote:
> This is broken for C11 and C17 (even before you touch anything). As we just 
> talked about, let's have a helper function to detect the oldest version (and 
> maybe even that should get promoted as a LANGOPT).
From the declarations in `include/clang/Frontend/LangStandards.def`, newer 
versions of C bitwise OR together flags of previous versions. So C99 sets C99 
flag, C11 sets C99 and C11 flags, and C17 sets C99, C11, and C17 flags.

So this should be correct (though even to me, this looks wrong on first 
glance).  Thanks to @george.burgess.iv and you for help in looking into this.


Repository:
  rC Clang

https://reviews.llvm.org/D52248



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

Reply via email to