[clang] [Clang][AST] Add source range for deleted and defaulted functions (PR #205408)

Shreyansh Lodha via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 26 07:42:52 PDT 2026


================
@@ -0,0 +1,33 @@
+// RUN: %clang_cc1 -std=c++11 -ast-dump %s | FileCheck %s
+
+void delfunc() = delete;
+// CHECK: FunctionDecl{{.*}} <{{.*}}[[@LINE-1]]:1, col:23> col:6 delfunc 'void ()' delete
+
+struct S {
+  inline S();
+};
+
+inline S::S() = default;
+// CHECK: CXXConstructorDecl{{.*}} <line:[[@LINE-1]]:1, col:23>{{.*}}S 'void ()' inline default
+
+struct v {
+  void f() = delete;
+};
+// CHECK: CXXMethodDecl{{.*}} <line:[[@LINE-2]]:3, col:19> col:8 f 'void ()' delete
+
+class Truck {
+  inline Truck();
+};
+
+inline Truck::Truck() = default;
----------------
lodha1503 wrote:

sure i will do it. They both are serving the same purpose

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


More information about the cfe-commits mailing list