Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/Sema/Sema.h | ||
---|---|---|
3288 | Initially I've changed the type to catch various return ActOnObjCContainerStartDefinition.. Now it's not really required. What type do you think it should be? We can do both Decl * and ObjCContainerDecl * though none of those is particularly useful. I've decided to keep void because we don't use the returned value anyway. I was also considering template <typename ObjCDeclTy> ObjCDeclTy *ActOnObjCContainerStartDefinition(ObjCDeclTy *IDecl); but I feel like the introduced complexity isn't worth it. | |
clang/lib/Sema/SemaDecl.cpp | ||
17094 | I believe you are right and the cast is not required. Though we cannot compare ObjCCtx and CurContext, we need to compare DeclContext *DC. Also dropped a similar cast in ActOnObjCContainerStartDefinition. |
clang/include/clang/Sema/Sema.h | ||
---|---|---|
3288 | I see. I'm fine with having void here, what caught my attention was changing return ActOnObjCContainerStartDefinition(X); into ActOnObjCContainerStartDefinition(X); return X; that's perfectly fine though. | |
clang/lib/Sema/SemaDecl.cpp | ||
17094 | Interesting, I would expect that ObjCCtx == CurContext would have implicit upcast of ObjCCtx to DeclContext *. Same for the assignment. |
clang/lib/Sema/SemaDecl.cpp | ||
---|---|---|
17094 | D'oh, relying on values in debugger isn't always correct. You are right, according to [expr.eq]p2 both operands are brought to their composite pointer type and [conv.ptr]p3 allows upcasting, so we don't need to have variables of the same time for comparison. |
Why the change in return type?