decl.c (grokvardecl): Simplify the latter.
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 21 Aug 2015 17:39:48 +0000 (17:39 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 21 Aug 2015 17:39:48 +0000 (17:39 +0000)
2015-08-21  Paolo Carlini  <paolo.carlini@oracle.com>

* decl.c (grokvardecl): Simplify the latter.

From-SVN: r227078

gcc/cp/ChangeLog
gcc/cp/decl.c

index f8fae34b760adbc4dae0e254915286b684359760..bc613f088e1dc2af4940770a74843b592595b86e 100644 (file)
@@ -1,3 +1,7 @@
+2015-08-21  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       * decl.c (grokvardecl): Simplify the latter.
+
 2015-08-21  Paolo Carlini  <paolo.carlini@oracle.com>
 
        * decl.c (grokvardecl): Complete check added for c++/67065.
index ab55e75f27eab465a0270e4c24cc4870d3b4f8d3..205febc1dad43d18162a4c02e70f95b161defd4a 100644 (file)
@@ -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.