Fix column location in c_lex_with_flags errors

gcc/testsuite/ChangeLog:

2015-08-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* gcc.dg/cpp/multiline-2.c: Add column numbers.
	* gcc.dg/dollar.c: Likewise.
	* gcc.dg/pragma-message.c: Likewise.
	* g++.dg/cpp1y/digit-sep-neg.C: Likewise.
	* c-c++-common/raw-string-14.c: Likewise.

gcc/c-family/ChangeLog:

2015-08-22  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* c-lex.c (c_lex_with_flags): Use explicit locations.

From-SVN: r227096
parent ed9fa8d2
2015-08-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-lex.c (c_lex_with_flags): Use explicit locations.
2015-08-18 Trevor Saunders <tbsaunde@tbsaunde.org>
* c-ada-spec.h, c-common.c, c-common.h, c-format.c, c-format.h,
......
......@@ -523,11 +523,11 @@ c_lex_with_flags (tree *value, location_t *loc, unsigned char *cpp_flags,
cppchar_t c = tok->val.str.text[0];
if (c == '"' || c == '\'')
error ("missing terminating %c character", (int) c);
error_at (*loc, "missing terminating %c character", (int) c);
else if (ISGRAPH (c))
error ("stray %qc in program", (int) c);
error_at (*loc, "stray %qc in program", (int) c);
else
error ("stray %<\\%o%> in program", (int) c);
error_at (*loc, "stray %<\\%o%> in program", (int) c);
}
goto retry;
......
2015-08-22 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/cpp/multiline-2.c: Add column numbers.
* gcc.dg/dollar.c: Likewise.
* gcc.dg/pragma-message.c: Likewise.
* g++.dg/cpp1y/digit-sep-neg.C: Likewise.
* c-c++-common/raw-string-14.c: Likewise.
2015-08-21 Patrick Palka <ppalka@gcc.gnu.org>
* g++.old-deja/g++.jason/overload.C: Adjust to preserve original
......
......@@ -12,7 +12,7 @@ const void *s1 = R"??/
// { dg-error "invalid new-line" "invalid" { target *-*-* } 10 }
// { dg-error "stray" "stray" { target *-*-* } 10 }
// { dg-warning "missing terminating" "missing" { target *-*-* } 10 }
// { dg-error "missing terminating" "missing" { target *-*-* } 10 }
// { dg-error "19:missing terminating" "missing" { target *-*-* } 10 }
const void *s2 = R"abcdefghijklmn??/(a)abcdefghijklmn???";
// { dg-error "raw string delimiter longer" "longer" { target *-*-* } 16 }
// { dg-error "stray" "stray" { target *-*-* } 16 }
......
......@@ -10,7 +10,7 @@ main()
i = 0004''000'000; // { dg-error "adjacent digit separators" }
i = 0B1'0'0'0'0'0'0'0'0'0'0'0'0'0'0'0'0'0'0'0'0; // OK
i = 0b'0001'0000'0000'0000'0000'0000; // { dg-error "digit separator after base indicator" }
i = 0b0001'0000'0000'0000'0000'0000'; // { dg-error "missing terminating" }
i = 0b0001'0000'0000'0000'0000'0000'; // { dg-error "38:missing terminating" }
unsigned u = 0b0001'0000'0000'0000'0000'0000'U; // { dg-error "digit separator outside digit sequence" }
double d = 0.0;
......@@ -18,10 +18,10 @@ main()
d = 1.'602'176'565e-19; // { dg-error "digit separator adjacent to decimal point" }
d = 1.602''176'565e-19; // { dg-error "adjacent digit separators" }
d = 1.602'176'565'e-19; // { dg-error "digit separator adjacent to exponent" }
d = 1.602'176'565e'-19; // { dg-error "missing terminating" }
d = 1.602'176'565e'-19; // { dg-error "21:missing terminating" }
d = 1.602'176'565e-'19; // { dg-error "digit separator adjacent to exponent" }
d = 1.602'176'565e-1'9; // OK
d = 1.602'176'565e-19'; // { dg-error "missing terminating" }
d = 1.602'176'565e-19'; // { dg-error "24:missing terminating" }
float f = 1.602'176'565e-19'F; // { dg-error "digit separator outside digit sequence" }
}
......
......@@ -9,6 +9,6 @@ const char *p = "line 1
"
""; /* The compiler front end sees this. */
/* { dg-error "missing term" "multiline strings" { target *-*-* } 8 } */
/* { dg-error "17:missing term" "multiline strings" { target *-*-* } 8 } */
/* { dg-error "missing term" "multiline strings" { target *-*-* } 9 } */
......@@ -6,4 +6,4 @@
/* Test that -fno-dollars-in-identifiers is honoured.
Neil Booth, 17 May 2003. */
int foobar$; /* { dg-error "stray '\\$'" } */
int foobar$; /* { dg-error "11:stray '\\$'" } */
......@@ -16,13 +16,13 @@
matching dg-message), dejagnu will report these as excess errors. */
#pragma message "
/* { dg-error "missing terminating" "" { target *-*-* } 18 } */
/* { dg-error "17:missing terminating" "" { target *-*-* } 18 } */
/* { dg-warning "expected a string" "" { target *-*-* } 18 } */
#pragma message "Bad 1
/* { dg-error "missing terminating" "" { target *-*-* } 21 } */
/* { dg-error "17:missing terminating" "" { target *-*-* } 21 } */
/* { dg-warning "expected a string" "" { target *-*-* } 21 } */
#pragma message ("Bad 2
/* { dg-error "missing terminating" "" { target *-*-* } 24 } */
/* { dg-error "18:missing terminating" "" { target *-*-* } 24 } */
/* { dg-warning "expected a string" "" { target *-*-* } 24 } */
#pragma message ("Bad 3"
/* { dg-warning "malformed '#pragma message" "" { target *-*-* } 27 } */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment