diff options
| author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-24 00:01:37 +0000 |
|---|---|---|
| committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-10-24 00:01:37 +0000 |
| commit | f8821526dcd2c2f13d31408c43db63a8d125e39f (patch) | |
| tree | 3d5249f221f268561ba0e176a992e683d5880f57 | |
| parent | 21e334f91b0ba05b4dba7728ad8f07fb54f24833 (diff) | |
| download | ppe42-gcc-f8821526dcd2c2f13d31408c43db63a8d125e39f.tar.gz ppe42-gcc-f8821526dcd2c2f13d31408c43db63a8d125e39f.zip | |
PR c++/8067
* decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and
related variables.
PR c++/8067
* g++.dg/lookup/pretty1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@58477 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
| -rw-r--r-- | gcc/cp/decl.c | 6 | ||||
| -rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/testsuite/g++.dg/lookup/pretty1.C | 1 |
4 files changed, 16 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bca3b4c3570..e6ed9295e15 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2002-10-23 Mark Mitchell <mark@codesourcery.com> + PR c++/8067 + * decl.c (maybe_inject_for_scope_var): Ignore __FUNCTION__ and + related variables. + PR c++/7679 * spew.c (next_token): Do not return an endless stream of END_OF_SAVED_INPUT tokens. diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index b52622a03a8..97ab9462e6a 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8175,6 +8175,12 @@ maybe_inject_for_scope_var (decl) { if (!DECL_NAME (decl)) return; + + /* Declarations of __FUNCTION__ and its ilk appear magically when + the variable is first used. If that happens to be inside a + for-loop, we don't want to do anything special. */ + if (DECL_PRETTY_FUNCTION_P (decl)) + return; if (current_binding_level->is_for_scope) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e2fa07709ca..fc2c7c2c302 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2002-10-23 Mark Mitchell <mark@codesourcery.com> + + PR c++/8067 + * g++.dg/lookup/pretty1.C: New test. + 2002-10-23 Jakub Jelinek <jakub@redhat.com> * gcc.dg/20021023-1.c: New test. diff --git a/gcc/testsuite/g++.dg/lookup/pretty1.C b/gcc/testsuite/g++.dg/lookup/pretty1.C new file mode 100644 index 00000000000..a03bd3c3e8a --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/pretty1.C @@ -0,0 +1 @@ +void foo() { for ( __PRETTY_FUNCTION__ ; ; ) ; } |

