[clang] [Clang][Sema] fix crash of attribute transform (PR #78088)

Qizhi Hu via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 21:02:04 PST 2024


================
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 %s -verify -fsyntax-only
+
+// expected-no-diagnostics
+
+template<typename T>
+struct Bar {
+    int* data;
+
+    auto operator[](const int index) const [[clang::lifetimebound]] -> decltype(data[index]) {
+        return data[index];
+    }
+};
+
+int main() {
+    Bar<int> b;
+    (void)b[2];
+}
----------------
jcsxky wrote:

Done

https://github.com/llvm/llvm-project/pull/78088


More information about the cfe-commits mailing list