Unexpected tokens after conditionals should be an error instead of a warning.
Fixes:
dEQP-GLES2.functional.shaders.preprocessor.invalid_conditionals.tokens_after_if_vertex
dEQP-GLES2.functional.shaders.preprocessor.invalid_conditionals.tokens_after_if_fragment
dEQP-GLES2.functional.shaders.preprocessor.invalid_conditionals.tokens_after_else_vertex
dEQP-GLES2.functional.shaders.preprocessor.invalid_conditionals.tokens_after_else_fragment
dEQP-GLES2.functional.shaders.preprocessor.invalid_conditionals.tokens_after_endif_vertex
dEQP-GLES2.functional.shaders.preprocessor.invalid_conditionals.tokens_after_endif_fragment
dEQP-GLES2.functional.shaders.preprocessor.invalid_conditionals.tokens_after_ifdef_vertex
dEQP-GLES2.functional.shaders.preprocessor.invalid_conditionals.tokens_after_ifdef_fragment
dEQP-GLES2.functional.shaders.preprocessor.invalid_conditionals.tokens_after_ifndef_vertex
dEQP-GLES2.functional.shaders.preprocessor.invalid_conditionals.tokens_after_ifndef_fragment
BUG=angleproject:989
Change-Id: I6511f7082c98206fb623775d81329b6bc7673c1a
Reviewed-on: https://chromium-review.googlesource.com/267638
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/preprocessor/DiagnosticsBase.h b/src/compiler/preprocessor/DiagnosticsBase.h
index e67fbff..9fd48be 100644
--- a/src/compiler/preprocessor/DiagnosticsBase.h
+++ b/src/compiler/preprocessor/DiagnosticsBase.h
@@ -52,6 +52,7 @@
PP_CONDITIONAL_ELIF_WITHOUT_IF,
PP_CONDITIONAL_ELIF_AFTER_ELSE,
PP_CONDITIONAL_UNTERMINATED,
+ PP_CONDITIONAL_UNEXPECTED_TOKEN,
PP_INVALID_EXTENSION_NAME,
PP_INVALID_EXTENSION_BEHAVIOR,
PP_INVALID_EXTENSION_DIRECTIVE,
@@ -67,7 +68,6 @@
PP_WARNING_BEGIN,
PP_EOF_IN_DIRECTIVE,
- PP_CONDITIONAL_UNEXPECTED_TOKEN,
PP_UNRECOGNIZED_PRAGMA,
PP_WARNING_END
};
diff --git a/src/compiler/preprocessor/DirectiveParser.cpp b/src/compiler/preprocessor/DirectiveParser.cpp
index 62fe6ab..cbc6ce0 100644
--- a/src/compiler/preprocessor/DirectiveParser.cpp
+++ b/src/compiler/preprocessor/DirectiveParser.cpp
@@ -492,7 +492,7 @@
block.skipGroup = block.foundValidGroup;
block.foundValidGroup = true;
- // Warn if there are extra tokens after #else.
+ // Check if there are extra tokens after #else.
mTokenizer->lex(token);
if (!isEOD(token))
{
@@ -556,7 +556,7 @@
mConditionalStack.pop_back();
- // Warn if there are tokens after #endif.
+ // Check if there are tokens after #endif.
mTokenizer->lex(token);
if (!isEOD(token))
{
@@ -925,7 +925,7 @@
macroExpander.lex(token);
expressionParser.parse(token, &expression);
- // Warn if there are tokens after #if expression.
+ // Check if there are tokens after #if expression.
if (!isEOD(token))
{
mDiagnostics->report(Diagnostics::PP_CONDITIONAL_UNEXPECTED_TOKEN,
@@ -953,7 +953,7 @@
MacroSet::const_iterator iter = mMacroSet->find(token->text);
int expression = iter != mMacroSet->end() ? 1 : 0;
- // Warn if there are tokens after #ifdef expression.
+ // Check if there are tokens after #ifdef expression.
mTokenizer->lex(token);
if (!isEOD(token))
{