Skip to content

Commit e4a03e7

Browse files
committed
revert code I did not intend to modify
1 parent a56cfe9 commit e4a03e7

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20678,8 +20678,7 @@ ExprResult RebuildUnknownAnyExpr::VisitCallExpr(CallExpr *E) {
2067820678
const FunctionType *FnType = CalleeType->castAs<FunctionType>();
2067920679

2068020680
// Verify that this is a legal result type of a function.
20681-
if ((!S.getLangOpts().HLSL && DestType->isArrayType()) ||
20682-
DestType->isFunctionType()) {
20681+
if (DestType->isArrayType() || DestType->isFunctionType()) {
2068320682
unsigned diagID = diag::err_func_returning_array_function;
2068420683
if (Kind == FK_BlockPointer)
2068520684
diagID = diag::err_block_returning_array_function;

clang/lib/Sema/SemaType.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2527,7 +2527,7 @@ QualType Sema::BuildMatrixType(QualType ElementTy, Expr *NumRows, Expr *NumCols,
25272527
}
25282528

25292529
bool Sema::CheckFunctionReturnType(QualType T, SourceLocation Loc) {
2530-
if ((!getLangOpts().HLSL && T->isArrayType()) || T->isFunctionType()) {
2530+
if (T->isArrayType() || T->isFunctionType()) {
25312531
Diag(Loc, diag::err_func_returning_array_function)
25322532
<< T->isFunctionType() << T;
25332533
return true;
@@ -4931,9 +4931,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state,
49314931

49324932
// C99 6.7.5.3p1: The return type may not be a function or array type.
49334933
// For conversion functions, we'll diagnose this particular error later.
4934-
if (!D.isInvalidType() &&
4935-
((!S.getLangOpts().HLSL && T->isArrayType()) ||
4936-
T->isFunctionType()) &&
4934+
if (!D.isInvalidType() && (T->isArrayType() || T->isFunctionType()) &&
49374935
(D.getName().getKind() !=
49384936
UnqualifiedIdKind::IK_ConversionFunctionId)) {
49394937
unsigned diagID = diag::err_func_returning_array_function;

0 commit comments

Comments
 (0)