]> granicus.if.org Git - clang/commitdiff
fix PR2639
authorChris Lattner <sabre@nondot.org>
Mon, 2 Mar 2009 20:58:48 +0000 (20:58 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 2 Mar 2009 20:58:48 +0000 (20:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65869 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/TextDiagnosticPrinter.cpp
test/Sema/implicit-int.c

index 939a65f406dacc4ff083b14bdc4107617da9b229..d3e46ff0292bd5a45c6da53a856b944d851b8fc5 100644 (file)
@@ -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
index f15a40fa083522ac267551dcc81de9bfccbbc5d7..6edc1f6e20e952b12ded0e28b9db36089108ef75 100644 (file)
@@ -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'}}
+}
+