Commit 19843834 by Mark Mitchell Committed by Mark Mitchell

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
parent 39d16468
2005-10-03 Mark Mitchell <mark@codesourcery.com>
PR c++/17775
* repo.c: Include flags.h.
(finish_repo): Add -frandom-seed to the arguments.
2005-10-02 Mark Mitchell <mark@codesourcery.com> 2005-10-02 Mark Mitchell <mark@codesourcery.com>
PR c++/22621 PR c++/22621
......
...@@ -36,6 +36,7 @@ Boston, MA 02110-1301, USA. */ ...@@ -36,6 +36,7 @@ Boston, MA 02110-1301, USA. */
#include "obstack.h" #include "obstack.h"
#include "toplev.h" #include "toplev.h"
#include "diagnostic.h" #include "diagnostic.h"
#include "flags.h"
static char *extract_string (char **); static char *extract_string (char **);
static const char *get_base_filename (const char *); static const char *get_base_filename (const char *);
...@@ -239,7 +240,16 @@ finish_repo (void) ...@@ -239,7 +240,16 @@ finish_repo (void)
fprintf (repo_file, "D %s\n", dir); fprintf (repo_file, "D %s\n", dir);
args = getenv ("COLLECT_GCC_OPTIONS"); args = getenv ("COLLECT_GCC_OPTIONS");
if (args) 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)) for (t = pending_repo; t; t = TREE_CHAIN (t))
{ {
......
2005-10-03 Mark Mitchell <mark@codesourcery.com>
PR c++/17775
* g++.dg/template/repo4.C: New test.
2005-10-03 Francois-Xavier Coudert <coudert@clipper.ens.fr> 2005-10-03 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/19308 PR libfortran/19308
// PR c++/17775
// { dg-options "-frepo" }
// { dg-final { cleanup-repo-files } }
namespace {
struct Foo {};
}
template <typename Tp>
void foo(Tp) {}
int
main()
{
foo(Foo());
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment