aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/function.c3
-rw-r--r--gcc/testsuite/g++.dg/other/pr100580.C8
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/function.c b/gcc/function.c
index a3ed398..fc7b147 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -4930,6 +4930,9 @@ push_dummy_function (bool with_decl)
fn_result_decl = build_decl (UNKNOWN_LOCATION, RESULT_DECL,
NULL_TREE, void_type_node);
DECL_RESULT (fn_decl) = fn_result_decl;
+ DECL_ARTIFICIAL (fn_decl) = 1;
+ tree fn_name = get_identifier (" ");
+ SET_DECL_ASSEMBLER_NAME (fn_decl, fn_name);
}
else
fn_decl = NULL_TREE;
diff --git a/gcc/testsuite/g++.dg/other/pr100580.C b/gcc/testsuite/g++.dg/other/pr100580.C
new file mode 100644
index 0000000..d6cc0a6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/pr100580.C
@@ -0,0 +1,8 @@
+// PR c++/100580
+// { dg-do compile }
+// { dg-require-weak "" }
+// { dg-options "-fdump-passes" }
+// { dg-prune-output ".*" }
+
+int foo;
+static __typeof(foo) bar __attribute__((__weakref__("foo")));