From: Paolo Carlini Date: Fri, 21 Aug 2015 17:39:48 +0000 (+0000) Subject: decl.c (grokvardecl): Simplify the latter. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d8f29cc0219c7f909f1a599d82f7f8e7985bbe17;p=gcc.git decl.c (grokvardecl): Simplify the latter. 2015-08-21 Paolo Carlini * decl.c (grokvardecl): Simplify the latter. From-SVN: r227078 --- 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.