Skip to content

Commit 8c0c46a

Browse files
committed
Merged the two diagnostic types
1 parent 8ddec06 commit 8c0c46a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

clang/include/clang/Basic/DiagnosticSemaKinds.td

+1-3
Original file line numberDiff line numberDiff line change
@@ -9286,9 +9286,7 @@ def err_typecheck_expect_scalar_or_vector : Error<
92869286
"invalid operand of type %0 where %1 or "
92879287
"a vector of such type is required">;
92889288
def err_typecheck_expect_any_scalar_or_vector : Error<
9289-
"invalid operand of type %0 where a scalar or vector is required">;
9290-
def err_typecheck_expect_scalar_or_vector_not_type : Error<
9291-
"invalid operand of type %0">;
9289+
"invalid operand of type %0%select{| where a scalar or vector is required}1">;
92929290
def err_typecheck_expect_flt_or_vector : Error<
92939291
"invalid operand of type %0 where floating, complex or "
92949292
"a vector of such types is required">;

clang/lib/Sema/SemaHLSL.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,7 @@ static bool CheckAnyScalarOrVector(Sema *S, CallExpr *TheCall,
18471847
(VTy && VTy->getElementType()->isScalarType()))) {
18481848
S->Diag(TheCall->getArg(0)->getBeginLoc(),
18491849
diag::err_typecheck_expect_any_scalar_or_vector)
1850-
<< ArgType;
1850+
<< ArgType << 1;
18511851
return true;
18521852
}
18531853
return false;
@@ -1863,8 +1863,8 @@ static bool CheckWaveActive(Sema *S, CallExpr *TheCall) {
18631863
(VTy &&
18641864
S->Context.hasSameUnqualifiedType(VTy->getElementType(), BoolType))) {
18651865
S->Diag(TheCall->getArg(0)->getBeginLoc(),
1866-
diag::err_typecheck_expect_scalar_or_vector_not_type)
1867-
<< ArgType << BoolType;
1866+
diag::err_typecheck_expect_any_scalar_or_vector)
1867+
<< ArgType << 0;
18681868
return true;
18691869
}
18701870
return false;

0 commit comments

Comments
 (0)