[PATCH] D134286: [C2x] implement typeof and typeof_unqual
Shafik Yaghmour via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 20 10:15:58 PDT 2022
shafik added inline comments.
================
Comment at: clang/include/clang/AST/ASTContext.h:1717
/// GCC extension.
+ QualType getTypeOfExprType(Expr *E, bool IsUnqual) const;
----------------
I guess these are not purely extensions anymore?
================
Comment at: clang/include/clang/AST/Type.h:1071
+ /// Returns the typeof_unqual-unqualified version of the type.
+ QualType getTypeofUnqualType() const;
----------------
I think your trying to say this is more than the unqualified type but maybe just be more explicit like `it returns the ununqualified type including atomic type qualification and type attributes which behave like a qualifier, such as an address space attribute`
================
Comment at: clang/include/clang/AST/Type.h:4601
+ QualType QT = getUnderlyingType();
+ return IsUnqual ? QT.getTypeofUnqualType() : QT;
+ }
----------------
It is interesting that you do `getTypeofUnqualType` in the constructor and then you have to do it again when desuguring. Is this tested in the tests?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D134286/new/
https://reviews.llvm.org/D134286
More information about the cfe-commits
mailing list