aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index e81e9d3..e0b455c 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -33060,6 +33060,12 @@ cp_parser_pragma (cp_parser *parser, enum pragma_context context)
case PRAGMA_IVDEP:
{
+ if (context == pragma_external)
+ {
+ error_at (pragma_tok->location,
+ "%<#pragma GCC ivdep%> must be inside a function");
+ break;
+ }
cp_parser_skip_to_pragma_eol (parser, pragma_tok);
cp_token *tok;
tok = cp_lexer_peek_token (the_parser->lexer);