[PATCH] D125882: Correct the diagnostic behavior for unreachable _Generic associations in C++

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 18 09:44:18 PDT 2022


aaron.ballman added inline comments.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:1699
+          // If T is a non-class type, the type of the prvalue is the cv-
+          // unqualified version of T. Otherwise, the type of the prvalue is T.
           unsigned Reason = 0;
----------------
erichkeane wrote:
> This seems like it is a sentence short (or perhaps I'm a few synapses short?). 
> 
> The fallout from these rules is that "Non-class-types" never have qualifiers, thus cannot match a qualified type, but a class-type can, because it keeps its qualifiers?
> 
>  
> The fallout from these rules is that "Non-class-types" never have qualifiers, thus cannot match a qualified type, but a class-type can, because it keeps its qualifiers?

Correct for C++ -- the basic idea is that in C, all qualifiers are stripped, and in C++, only non-class type types have their qualifiers stripped. I'll update the comment when landing.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125882



More information about the cfe-commits mailing list