PR c++/55357
* semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
parms to avoid duplicate -Wshadow warnings.
From-SVN: r196739
2013-03-16 Jason Merrill <jason@redhat.com>
+ PR c++/55357
+ * semantics.c (maybe_add_lambda_conv_op): Clear DECL_NAME of copied
+ parms to avoid duplicate -Wshadow warnings.
+
* search.c (lookup_base): Handle NULL_TREE.
PR c++/56481
DECL_STATIC_FUNCTION_P (fn) = 1;
DECL_ARGUMENTS (fn) = copy_list (DECL_CHAIN (DECL_ARGUMENTS (callop)));
for (arg = DECL_ARGUMENTS (fn); arg; arg = DECL_CHAIN (arg))
- DECL_CONTEXT (arg) = fn;
+ {
+ /* Avoid duplicate -Wshadow warnings. */
+ DECL_NAME (arg) = NULL_TREE;
+ DECL_CONTEXT (arg) = fn;
+ }
if (nested)
DECL_INTERFACE_KNOWN (fn) = 1;
--- /dev/null
+// PR c++/55357
+// { dg-options "-std=c++11 -Wshadow" }
+
+int main() {
+ int x = 1; // { dg-warning "shadowed" }
+ auto const lambda = [](int x) { // { dg-warning "shadows" }
+ return x;
+ };
+}