fix PR2639
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65869 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp
index 939a65f..d3e46ff 100644
--- a/lib/Frontend/TextDiagnosticPrinter.cpp
+++ b/lib/Frontend/TextDiagnosticPrinter.cpp
@@ -218,7 +218,7 @@
// We have an insertion hint. Determine whether the inserted
// code is on the same line as the caret.
std::pair<FileID, unsigned> HintLocInfo
- = SM.getDecomposedLoc(Hint->InsertionLoc);
+ = SM.getDecomposedInstantiationLoc(Hint->InsertionLoc);
if (SM.getLineNumber(HintLocInfo.first, HintLocInfo.second) ==
SM.getLineNumber(FID, FileOffset)) {
// Insert the new code into the line just below the code
diff --git a/test/Sema/implicit-int.c b/test/Sema/implicit-int.c
index f15a40f..6edc1f6 100644
--- a/test/Sema/implicit-int.c
+++ b/test/Sema/implicit-int.c
@@ -8,3 +8,17 @@
// rdar://6131634
void f((x)); // expected-warning {{type specifier missing, defaults to 'int'}}
+
+// PR2639
+#define PAD(ms10) { \
+ register i; \
+}
+
+#define ILPAD() PAD((NROW - tt.tt_row) * 10) /* 1 ms per char */
+
+void
+h19_insline(n) // expected-warning {{parameter 'n' was not declared, defaulting to type 'int'}}
+{
+ ILPAD(); // expected-warning {{type specifier missing, defaults to 'int'}}
+}
+