summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/CodeGen/CGExprAgg.cpp5
-rw-r--r--clang/test/CodeGenCXX/debug-info-line.cpp12
2 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExprAgg.cpp b/clang/lib/CodeGen/CGExprAgg.cpp
index 80b16dd5ba3..7d05d48e85d 100644
--- a/clang/lib/CodeGen/CGExprAgg.cpp
+++ b/clang/lib/CodeGen/CGExprAgg.cpp
@@ -1387,7 +1387,12 @@ void CodeGenFunction::EmitAggExpr(const Expr *E, AggValueSlot Slot) {
// Optimize the slot if possible.
CheckAggExprForMemSetUse(Slot, E, *this);
+ bool hasDebugInfo = getDebugInfo();
+ if (isa<CXXDefaultArgExpr>(E))
+ disableDebugInfo();
AggExprEmitter(*this, Slot).Visit(const_cast<Expr*>(E));
+ if (isa<CXXDefaultArgExpr>(E) && hasDebugInfo)
+ enableDebugInfo();
}
LValue CodeGenFunction::EmitAggExprToLValue(const Expr *E) {
diff --git a/clang/test/CodeGenCXX/debug-info-line.cpp b/clang/test/CodeGenCXX/debug-info-line.cpp
index f6ce53e2e32..4a06145f502 100644
--- a/clang/test/CodeGenCXX/debug-info-line.cpp
+++ b/clang/test/CodeGenCXX/debug-info-line.cpp
@@ -274,6 +274,17 @@ void f22() {
}
}
+// CHECK-LABEL: define
+struct f23_struct {
+};
+f23_struct f23_a();
+void f23_b(f23_struct = f23_a());
+void f23() {
+// CHECK: call {{.*}}f23_a{{.*}}, !dbg [[DBG_F23:![0-9]*]]
+#line 2500
+ f23_b();
+}
+
// CHECK: [[DBG_F1]] = !MDLocation(line: 100,
// CHECK: [[DBG_FOO_VALUE]] = !MDLocation(line: 200,
// CHECK: [[DBG_FOO_REF]] = !MDLocation(line: 202,
@@ -302,3 +313,4 @@ void f22() {
// CHECK: [[DBG_F19_1]] = !MDLocation(line: 2100,
// CHECK: [[DBG_F19_2]] = !MDLocation(line: 2101,
// CHECK: [[DBG_F20_1]] = !MDLocation(line: 2200,
+// CHECK: [[DBG_F23]] = !MDLocation(line: 2500,
OpenPOWER on IntegriCloud