[clang] [Clang] Bugfixes and improved support for `AttributedType`s in lambdas (PR #85325)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 19 08:48:50 PDT 2024


================
@@ -3140,13 +3184,20 @@ const FunctionType *ASTContext::adjustFunctionType(const FunctionType *T,
   return cast<FunctionType>(Result.getTypePtr());
 }
 
+QualType ASTContext::adjustFunctionResultType(QualType FunctionType,
+                                              QualType ResultType) {
+  return adjustType(FunctionType, [&](QualType Orig) {
+    const auto *FPT = Orig->castAs<FunctionProtoType>();
----------------
AaronBallman wrote:

There's a bit of a gotcha here -- functions without prototypes have a result type that could be adjusted, so this will cause an assertion that the caller is unlikely to expect. Can we have a fallback for functions without prototypes and some test coverage for those?

https://github.com/llvm/llvm-project/pull/85325


More information about the cfe-commits mailing list