From 4df47bca15b2d9f5eb3832b05121cdd984c76da1 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 11 Feb 2011 18:13:11 +0000 Subject: re PR driver/47678 (missing error message for -I) PR driver/47678 * gcc.c (main): Do not compile inputs if there were errors in option handling. * opts-common.c (read_cmdline_option): Check for wrong language after other error checks. testsuite: * gcc.dg/opts-6.c: New test. From-SVN: r170056 --- gcc/opts-common.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'gcc/opts-common.c') diff --git a/gcc/opts-common.c b/gcc/opts-common.c index e6cb552..3c4044a 100644 --- a/gcc/opts-common.c +++ b/gcc/opts-common.c @@ -960,12 +960,6 @@ read_cmdline_option (struct gcc_options *opts, return; } - if (decoded->errors & CL_ERR_WRONG_LANG) - { - handlers->wrong_lang_callback (decoded, lang_mask); - return; - } - if (decoded->errors & CL_ERR_MISSING_ARG) { if (option->missing_argument_error) @@ -1012,6 +1006,12 @@ read_cmdline_option (struct gcc_options *opts, return; } + if (decoded->errors & CL_ERR_WRONG_LANG) + { + handlers->wrong_lang_callback (decoded, lang_mask); + return; + } + gcc_assert (!decoded->errors); if (!handle_option (opts, opts_set, decoded, lang_mask, DK_UNSPECIFIED, -- cgit v1.1