diff options
author | Justin Bogner <mail@justinbogner.com> | 2024-11-19 10:33:54 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-19 10:33:54 -0800 |
commit | 2186a008c98e8bb6738fe9120441d6bd15c272f3 (patch) | |
tree | 4d196fa5d11de23035e4cfa126f83cc140426e16 /clang/lib/Sema/HLSLExternalSemaSource.cpp | |
parent | 8bdf13b11638d2f3e6792a573fc2be830a03790a (diff) | |
download | llvm-2186a008c98e8bb6738fe9120441d6bd15c272f3.zip llvm-2186a008c98e8bb6738fe9120441d6bd15c272f3.tar.gz llvm-2186a008c98e8bb6738fe9120441d6bd15c272f3.tar.bz2 |
[HLSL] Fix placement of `const` for resource operator[] (#116698)
We had an incorrect AST here - We want `const T &`, not `T &const`.
Diffstat (limited to 'clang/lib/Sema/HLSLExternalSemaSource.cpp')
-rw-r--r-- | clang/lib/Sema/HLSLExternalSemaSource.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/HLSLExternalSemaSource.cpp b/clang/lib/Sema/HLSLExternalSemaSource.cpp index 9b18853..a14e7d5 100644 --- a/clang/lib/Sema/HLSLExternalSemaSource.cpp +++ b/clang/lib/Sema/HLSLExternalSemaSource.cpp @@ -212,11 +212,11 @@ struct BuiltinTypeDeclBuilder { // Subscript operators return references to elements, const makes the // reference and method const so that the underlying data is not mutable. - ReturnTy = AST.getLValueReferenceType(ReturnTy); if (IsConst) { ExtInfo.TypeQuals.addConst(); ReturnTy.addConst(); } + ReturnTy = AST.getLValueReferenceType(ReturnTy); QualType MethodTy = AST.getFunctionType(ReturnTy, {AST.UnsignedIntTy}, ExtInfo); |