diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-24 06:37:58 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-24 06:37:58 +0000 |
commit | 837f1ad9cb6676996d95b51ff31b84f9fdcde244 (patch) | |
tree | 9808923eae1fa32febf544a3601b98861ccf5a8e /gcc | |
parent | e2bb72c9f9cac1483d7de8a766ccb8881eb1745b (diff) | |
download | gcc-837f1ad9cb6676996d95b51ff31b84f9fdcde244.tar.gz |
PR c++/17163
* pt.c (instantiate_decl): Do not try to apply
DECL_DECLARED_INLINED_P to a VAR_DECL.
PR c++/17163
* g++.dg/template/repo2.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86467 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/pt.c | 4 | ||||
-rw-r--r-- | gcc/cp/search.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/template/repo2.C | 14 |
5 files changed, 31 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1c0f95ec521..7e013c79225 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2004-08-23 Mark Mitchell <mark@codesourcery.com> + + PR c++/17163 + * pt.c (instantiate_decl): Do not try to apply + DECL_DECLARED_INLINED_P to a VAR_DECL. + + * search.c (build_baselink): Fix typo in comment. + 2004-08-22 Andrew Pinski <apinski@apple.com> Revert: diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 8ee4be9f804..b995ba41daa 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11183,7 +11183,9 @@ instantiate_decl (tree d, int defer_ok, int undefined_ok) /* Instantiate inline functions so that the inliner can do its job, even though we'll not be emitting a copy of this function. */ - if (!flag_inline_trees || !DECL_DECLARED_INLINE_P (d)) + if (!(TREE_CODE (d) == FUNCTION_DECL + && flag_inline_trees + && DECL_DECLARED_INLINE_P (d))) goto out; } diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 459c1742705..df5804b29ef 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -1135,7 +1135,7 @@ lookup_field_r (tree binfo, void *data) return NULL_TREE; } -/* Return a "baselink" which BASELINK_BINFO, BASELINK_ACCESS_BINFO, +/* Return a "baselink" with BASELINK_BINFO, BASELINK_ACCESS_BINFO, BASELINK_FUNCTIONS, and BASELINK_OPTYPE set to BINFO, ACCESS_BINFO, FUNCTIONS, and OPTYPE respectively. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 38b1d24b7eb..343d3bba591 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-08-23 Mark Mitchell <mark@codesourcery.com> + + PR c++/17163 + * g++.dg/template/repo2.C: New test. + 2004-08-23 Roger Sayle <roger@eyesopen.com> PR rtl-optimization/17078 diff --git a/gcc/testsuite/g++.dg/template/repo2.C b/gcc/testsuite/g++.dg/template/repo2.C new file mode 100644 index 00000000000..0fc960b603a --- /dev/null +++ b/gcc/testsuite/g++.dg/template/repo2.C @@ -0,0 +1,14 @@ +// PR c++/17163 +// { dg-options "-frepo" } + +template <int __inst> +struct __Atomicity_lock +{ + static unsigned char _S_atomicity_lock; +}; +template <int __inst> +unsigned char __Atomicity_lock<__inst>::_S_atomicity_lock = 0; +template unsigned char __Atomicity_lock<0>::_S_atomicity_lock; + +int main () { +} |