public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57526] New: use of X before deduction of auto error for seemingly good code
@ 2013-06-04 15:36 plasmahh at gmx dot net
  2013-06-04 15:39 ` [Bug c++/57526] [4.8/4.9 Regression] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: plasmahh at gmx dot net @ 2013-06-04 15:36 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57526

            Bug ID: 57526
           Summary: use of X before deduction of auto error for seemingly
                    good code
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: plasmahh at gmx dot net

Hi,

for the following code

template<class T>
struct A
{
        void bar( ) { }

        void foo( )
        {
                auto* this_ptr = this;
                auto lc = [&]( )
                {
                        this_ptr->bar();
                };
                lc();
        }
};

int main(int argc, const char *argv[])
{
        A<int> a;
        a.foo();
}


I get gcc 4.8.{0,1} error me out with:

auto.cxx:12:4: error: use of 'A<T>::foo() [with T =
int]::__lambda0::__this_ptr' before deduction of 'auto'
                        this_ptr->bar();

which for one was not the case with gcc 4.7. There are two (strange) ways to
make it go away: Either make it be "auto" isntead of "auto*" or make A not
being a template. I also could not find anything in the standard that would
disallow this.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/57526] [4.8/4.9 Regression] use of X before deduction of auto error for seemingly good code
  2013-06-04 15:36 [Bug c++/57526] New: use of X before deduction of auto error for seemingly good code plasmahh at gmx dot net
@ 2013-06-04 15:39 ` redi at gcc dot gnu.org
  2013-07-09  7:04 ` jason at gcc dot gnu.org
  2013-07-09 18:52 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2013-06-04 15:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57526

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-06-04
      Known to work|                            |4.6.3, 4.7.3
            Summary|use of X before deduction   |[4.8/4.9 Regression] use of
                   |of auto error for seemingly |X before deduction of auto
                   |good code                   |error for seemingly good
                   |                            |code
     Ever confirmed|0                           |1
      Known to fail|                            |4.8.0, 4.9.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/57526] [4.8/4.9 Regression] use of X before deduction of auto error for seemingly good code
  2013-06-04 15:36 [Bug c++/57526] New: use of X before deduction of auto error for seemingly good code plasmahh at gmx dot net
  2013-06-04 15:39 ` [Bug c++/57526] [4.8/4.9 Regression] " redi at gcc dot gnu.org
@ 2013-07-09  7:04 ` jason at gcc dot gnu.org
  2013-07-09 18:52 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2013-07-09  7:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57526

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |jason at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/57526] [4.8/4.9 Regression] use of X before deduction of auto error for seemingly good code
  2013-06-04 15:36 [Bug c++/57526] New: use of X before deduction of auto error for seemingly good code plasmahh at gmx dot net
  2013-06-04 15:39 ` [Bug c++/57526] [4.8/4.9 Regression] " redi at gcc dot gnu.org
  2013-07-09  7:04 ` jason at gcc dot gnu.org
@ 2013-07-09 18:52 ` jason at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: jason at gcc dot gnu.org @ 2013-07-09 18:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57526

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.8.2

--- Comment #1 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.8.2/4.9.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-07-09 18:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-04 15:36 [Bug c++/57526] New: use of X before deduction of auto error for seemingly good code plasmahh at gmx dot net
2013-06-04 15:39 ` [Bug c++/57526] [4.8/4.9 Regression] " redi at gcc dot gnu.org
2013-07-09  7:04 ` jason at gcc dot gnu.org
2013-07-09 18:52 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).