diff options
-rw-r--r-- | lib/Frontend/TextDiagnosticPrinter.cpp | 2 | ||||
-rw-r--r-- | test/Sema/implicit-int.c | 14 |
2 files changed, 15 insertions, 1 deletions
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<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 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'}} +} + |