[clang] [Clang] Fix wrong call location of `DefaultArgExpr`. (PR #119212)

via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 9 06:36:53 PST 2024


================
@@ -1012,3 +1012,21 @@ int h = Var<int>;
 
 
 }
+
+namespace GH119129 {
+struct X{
+  constexpr int foo(std::source_location loc = std::source_location::current()) {
+    return loc.line();
+  }
+};
+static_assert(X{}.foo() == __LINE__);
+static_assert(X{}.
+                foo() ==__LINE__);
+static_assert(X{}.
+
+
+                foo() ==__LINE__);
+#line 10000
+static_assert(X{}.
+                foo() == 10001);
+}
----------------
16bit-ykiko wrote:

Resolve

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


More information about the cfe-commits mailing list