gcc/libcpp
David Malcolm c3388e6249 Implement -Wmisleading-indentation
gcc/ChangeLog:
	* doc/invoke.texi (Warning Options): Add -Wmisleading-indentation.
	(-Wmisleading-indentation): New option.
	* Makefile.in (C_COMMON_OBJS): Add c-family/c-indentation.o.

gcc/c-family/ChangeLog:
	* c-common.h (warn_for_misleading_indentation): New prototype.
	* c-indentation.c: New file.
	* c.opt (Wmisleading-indentation): New option.

gcc/c/ChangeLog:
	* c-parser.c (c_parser_if_body): Add param "if_loc", use it
	to add a call to warn_for_misleading_indentation.
	(c_parser_else_body): Likewise, adding param "else_loc".
	(c_parser_if_statement): Check for misleading indentation.
	(c_parser_while_statement): Likewise.
	(c_parser_for_statement): Likewise.

gcc/cp/ChangeLog:
	* parser.c (cp_parser_selection_statement): Add location and
	guard_kind arguments to calls to
	cp_parser_implicitly_scoped_statement.
	(cp_parser_iteration_statement): Likewise for calls to
	cp_parser_already_scoped_statement.
	(cp_parser_implicitly_scoped_statement): Add "guard_loc" and
	"guard_kind" params; use them to warn for misleading
	indentation.
	(cp_parser_already_scoped_statement): Likewise.

gcc/testsuite/ChangeLog:
	* c-c++-common/Wmisleading-indentation.c: New testcase.
	* c-c++-common/Wmisleading-indentation-2.c: New testcase.
	* c-c++-common/Wmisleading-indentation-2.md: New file.

libcpp/ChangeLog:
	* directives.c (do_line): Set seen_line_directive on line_table.
	(do_linemarker): Likewise.
	* include/line-map.h (struct line_maps): Add new field
	"seen_line_directive".

From-SVN: r223098
2015-05-12 20:57:38 +00:00
..
include Implement -Wmisleading-indentation 2015-05-12 20:57:38 +00:00
po * sv.po: Update. 2015-05-01 17:23:49 +01:00
ChangeLog Implement -Wmisleading-indentation 2015-05-12 20:57:38 +00:00
ChangeLog.jit Merger of dmalcolm/jit branch from git 2014-11-11 21:55:52 +00:00
Makefile.in Update copyright years. 2015-01-05 13:33:28 +01:00
aclocal.m4
charset.c Update copyright years. 2015-01-05 13:33:28 +01:00
config.in configure.ac: Remove long long and __int64 type checks... 2014-05-26 08:19:02 +00:00
configure configure.ac: Remove long long and __int64 type checks... 2014-05-26 08:19:02 +00:00
configure.ac configure.ac: Remove long long and __int64 type checks... 2014-05-26 08:19:02 +00:00
directives-only.c Update copyright years. 2015-01-05 13:33:28 +01:00
directives.c Implement -Wmisleading-indentation 2015-05-12 20:57:38 +00:00
errors.c Update copyright years. 2015-01-05 13:33:28 +01:00
expr.c expr.c (cpp_classify_number): Add N_() around ?... 2015-01-16 18:40:15 +01:00
files.c re PR pch/65550 (ICE (segfault) with pch) 2015-04-09 13:37:53 +00:00
identifiers.c Update copyright years. 2015-01-05 13:33:28 +01:00
init.c lex.c (lex_string): Add -Wc++11-compat warning. 2015-05-09 00:50:10 -04:00
internal.h re PR preprocessor/65238 (__has_attribute is not handled properly with -traditional-cpp.) 2015-03-23 09:02:39 +01:00
lex.c lex.c (lex_string): Add -Wc++11-compat warning. 2015-05-09 00:50:10 -04:00
line-map.c libcpp: Improvements to comments in line-map.h/c 2015-05-05 14:21:02 +00:00
macro.c PR preprocessor/64803 - __LINE__ inside macro is not constant 2015-02-03 10:26:46 +01:00
makeucnid.c Update copyright years. 2015-01-05 13:33:28 +01:00
mkdeps.c Update copyright years. 2015-01-05 13:33:28 +01:00
pch.c Fix indentation issues seen by -Wmisleading-indentation 2015-05-05 19:41:11 +00:00
symtab.c Update copyright years. 2015-01-05 13:33:28 +01:00
system.h Update copyright years. 2015-01-05 13:33:28 +01:00
traditional.c re PR preprocessor/65238 (__has_attribute is not handled properly with -traditional-cpp.) 2015-03-23 09:02:39 +01:00
ucnid.h Update copyright years. 2015-01-05 13:33:28 +01:00
ucnid.tab Update copyright years. 2015-01-05 13:33:28 +01:00