This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][C++] Fix PR29433, make C++ use a lot less time/memory


On Mon, 11 Dec 2006, Richard Guenther wrote:

| On Mon, 11 Dec 2006, Gabriel Dos Reis wrote:
|
| > Michael Matz <matz@suse.de> writes:
| >
| > | Hi,
| > |
| > | On Sun, 9 Dec 2006, Gabriel Dos Reis wrote:
| > |
| > | > | More importantly, we know that this code is in our testsuite, in
| > | > | libstdc++, and accepted by EDG -- all of which suggests that this
| > | > | construct is likely in relatively widespread use.  I'm not sure that
| > | > | it's a good tradeoff to break that code for the sake of a diagnostic
| > | > | which is explicitly not required by the standard.
| > | >
| > | > And the code is explicitly invalid.  And we already reject the code,
| > |
| > | We don't currently, that's exactly the point of this thread.
| >
| >    % g++ -v && cat mm.C && g++ mm.C
| >    Using built-in specs.
| >    Target: i686-pc-linux-gnu
| >    Configured with: /home/gdr/redhat/trunk.gcc/configure
| >    --prefix=/home/gdr --enable-languages=c++
| >    Thread model: posix
| >    gcc version 4.3.0 20061109 (experimental)
| >    struct T { };
| >    struct S {
| >       T T();
| >    };
| >    mm.C:3: error: declaration of 'T S::T()'
| >    mm.C:1: error: changes meaning of 'T' from 'struct T'
|
| The testcase where behavior is changed with the patch is
|
| template <class _Tp> class auto_ptr {};
| template <class _Tp>
| class counted_ptr
| {
| public:
|  auto_ptr<_Tp> auto_ptr();
| };
|
| when there are templates involved.  We currently accept this but
| will reject it with the patch.

Yes, and that is what we should do.
My original message which Michael replied to had more context in
it than it appeared in his answer -- specifically the above example is
from a message by Mark I was answering "And we already reject the code".
It appears that excessive snippage had introduced a skew.

Your patch only brings consistency (we already rejects the
non-template case) and aligns us with the standard specification.
The struct stat hack does not apply in this speficase -- because of
the revaluation rule.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]