aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-11-20 17:39:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2022-05-14 11:43:32 +0000
commit5e801ac66d24704442eba426ed13c3effb8a34e7 (patch)
treefbacd59e1bd2f5ae75d5717a1274b95f12ac1c22 /contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp
parent349cc55c9796c4596a5b9904cd3281af295f878f (diff)
parent846a2208a8ab099f595fe7e8b2e6d54a7b5e67fb (diff)
Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp to llvmorg-14-init-10223-g401b76fdf2b3. PR: 261742 MFC after: 2 weeks
Diffstat (limited to 'contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp b/contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp
index 891909c443cc..635252584562 100644
--- a/contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp
+++ b/contrib/llvm-project/clang/lib/Sema/SemaExprCXX.cpp
@@ -1507,8 +1507,9 @@ Sema::BuildCXXTypeConstructExpr(TypeSourceInfo *TInfo,
ElemTy = Context.getBaseElementType(Ty);
}
- // There doesn't seem to be an explicit rule against this but sanity demands
- // we only construct objects with object types.
+ // Only construct objects with object types.
+ // There doesn't seem to be an explicit rule for this but functions are
+ // not objects, so they cannot take initializers.
if (Ty->isFunctionType())
return ExprError(Diag(TyBeginLoc, diag::err_init_for_function_type)
<< Ty << FullRange);