diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-10-03 17:21:40 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-10-03 17:21:40 +0000 |
commit | 198438344ceed3d2f91c0738d06b9ab06cf815aa (patch) | |
tree | fea276bce4881692ca7bc5a18c1dab22b21c6519 /gcc/cp/repo.c | |
parent | 39d164680db36b49c69e1d55cc0913153741fcba (diff) | |
download | gcc-198438344ceed3d2f91c0738d06b9ab06cf815aa.zip gcc-198438344ceed3d2f91c0738d06b9ab06cf815aa.tar.gz gcc-198438344ceed3d2f91c0738d06b9ab06cf815aa.tar.bz2 |
re PR c++/17775 (-frepo with function template in anonymous namespace fails to compile)
PR c++/17775
* repo.c: Include flags.h.
(finish_repo): Add -frandom-seed to the arguments.
PR c++/17775
* g++.dg/template/repo4.C: New test.
From-SVN: r104898
Diffstat (limited to 'gcc/cp/repo.c')
-rw-r--r-- | gcc/cp/repo.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c index b3d327d..eee3b87 100644 --- a/gcc/cp/repo.c +++ b/gcc/cp/repo.c @@ -36,6 +36,7 @@ Boston, MA 02110-1301, USA. */ #include "obstack.h" #include "toplev.h" #include "diagnostic.h" +#include "flags.h" static char *extract_string (char **); static const char *get_base_filename (const char *); @@ -239,7 +240,16 @@ finish_repo (void) fprintf (repo_file, "D %s\n", dir); args = getenv ("COLLECT_GCC_OPTIONS"); if (args) - fprintf (repo_file, "A %s\n", args); + { + fprintf (repo_file, "A %s", args); + /* If -frandom-seed is not among the ARGS, then add the value + that we chose. That will ensure that the names of types from + anonymous namespaces will get the same mangling when this + file is recompiled. */ + if (!strstr (args, "'-frandom-seed=")) + fprintf (repo_file, " '-frandom-seed=%s'", flag_random_seed); + fprintf (repo_file, "\n"); + } for (t = pending_repo; t; t = TREE_CHAIN (t)) { |