From d8f29cc0219c7f909f1a599d82f7f8e7985bbe17 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 21 Aug 2015 17:39:48 +0000 Subject: [PATCH] decl.c (grokvardecl): Simplify the latter. 2015-08-21 Paolo Carlini * decl.c (grokvardecl): Simplify the latter. From-SVN: r227078 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/decl.c | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f8fae34b760..bc613f088e1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2015-08-21 Paolo Carlini + + * decl.c (grokvardecl): Simplify the latter. + 2015-08-21 Paolo Carlini * decl.c (grokvardecl): Complete check added for c++/67065. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index ab55e75f27e..205febc1dad 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8357,8 +8357,7 @@ grokvardecl (tree type, if (DECL_NAME (decl) && MAIN_NAME_P (DECL_NAME (decl)) - && CP_DECL_CONTEXT (decl) == global_namespace - && !at_function_scope_p ()) + && scope == global_namespace) error ("cannot declare %<::main%> to be a global variable"); /* Check that the variable can be safely declared as a concept. -- 2.30.2