Ignore __restrict when check overload.

This commit is contained in:
Xiang Li 2017-08-03 14:38:29 -07:00
Родитель 00351f3f94
Коммит 524697bf66
2 изменённых файлов: 14 добавлений и 0 удалений

Просмотреть файл

@ -4866,6 +4866,7 @@ TryObjectArgumentInitialization(Sema &S, QualType FromType,
// First check the qualifiers.
QualType FromTypeCanon = S.Context.getCanonicalType(FromType);
// HLSL Change Starts - for calls other than subscript overloads, disregard const
FromTypeCanon.removeLocalRestrict(); // HLSL Change - disregard restrict.
if (!S.getLangOpts().HLSL ||
(Method != nullptr && Method->getDeclName() == S.Context.DeclarationNames.getCXXOperatorName(OO_Subscript))) {
// HLSL Change Ends

Просмотреть файл

@ -0,0 +1,13 @@
// RUN: %dxc -T lib_6_1 %s | FileCheck %s
// Make sure subscript on inout vector works.
// CHECK: noalias
struct A {
float2 s;
int2 i;
};
float test(inout A a) {
return a.s[1];
}