From 7b5b5b4409a64849908f67b9e389c0ba185b64b0 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 2 Mar 2009 20:58:48 +0000 Subject: [PATCH] fix PR2639 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65869 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/TextDiagnosticPrinter.cpp | 2 +- test/Sema/implicit-int.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/Frontend/TextDiagnosticPrinter.cpp b/lib/Frontend/TextDiagnosticPrinter.cpp index 939a65f406..d3e46ff029 100644 --- a/lib/Frontend/TextDiagnosticPrinter.cpp +++ b/lib/Frontend/TextDiagnosticPrinter.cpp @@ -218,7 +218,7 @@ void TextDiagnosticPrinter::EmitCaretDiagnostic(SourceLocation Loc, // We have an insertion hint. Determine whether the inserted // code is on the same line as the caret. std::pair 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 f15a40fa08..6edc1f6e20 100644 --- a/test/Sema/implicit-int.c +++ b/test/Sema/implicit-int.c @@ -8,3 +8,17 @@ y; // expected-warning {{type specifier missing, defaults to 'int'}} // 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'}} +} + -- 2.40.0