2011-12-15 Jakub Jelinek <jakub@redhat.com>
+ PR c++/51463
+ * decl.c (grokdeclarator): Set DECL_INITIAL of decl
+ to error_mark_node to disallow NSDMI if declspecs->storage_class
+ is sc_static.
+ * parser.c (cp_parser_late_parse_one_default_arg): Return early
+ if default_arg is error_mark_node.
+
PR c/51360
* semantics.c (finish_omp_clauses): For OMP_CLAUSE_NUM_THREADS_EXPR
and OMP_CLAUSE_SCHEDULE_CHUNK_EXPR call mark_rvalue_use.
}
if (initialized)
- /* An attempt is being made to initialize a non-static
- member. This is new in C++11. */
- maybe_warn_cpp0x (CPP0X_NSDMI);
+ {
+ /* An attempt is being made to initialize a non-static
+ member. This is new in C++11. */
+ maybe_warn_cpp0x (CPP0X_NSDMI);
+
+ /* If this has been parsed with static storage class, but
+ errors forced staticp to be cleared, ensure NSDMI is
+ not present. */
+ if (declspecs->storage_class == sc_static)
+ DECL_INITIAL (decl) = error_mark_node;
+ }
}
bad_specifiers (decl, BSP_FIELD, virtualp,
tree parsed_arg;
bool dummy;
+ if (default_arg == error_mark_node)
+ return error_mark_node;
+
/* Push the saved tokens for the default argument onto the parser's
lexer stack. */
tokens = DEFARG_TOKENS (default_arg);
2011-12-15 Jakub Jelinek <jakub@redhat.com>
+ PR c++/51463
+ * g++.dg/cpp0x/pr51463.C: New test.
+
PR c/51360
* c-c++-common/gomp/pr51360.c: New test.
* g++.dg/gomp/pr51360.C: New test.
PR middle-end/49806
- * gcc.dg/tree-ssa-vrp47.c: Add -fdump-tree-dom2 to dg-options.
+ * gcc.dg/tree-ssa/vrp47.c: Add -fdump-tree-dom2 to dg-options.
Check for x_? & y in dom2 dump and xfail the check in dom1 dump.
PR tree-optimization/51117
--- /dev/null
+// PR c++/51463
+// { dg-do compile }
+// { dg-options "-std=c++11" }
+
+struct A
+{
+ static virtual int i = 0; // { dg-error "both virtual and static|declared as" }
+};