public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56614] New: [4.7/4.8 Regression] error: default argument 'std::vector<E>(std::initializer_list<E>{((const E*)(& ._0)), 1u}, (*(const std::allocator<E>*)(& std::allocator<E>())))' uses local variable '._0'
@ 2013-03-13 14:46 redi at gcc dot gnu.org
  2013-03-13 16:48 ` [Bug c++/56614] " paolo.carlini at oracle dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: redi at gcc dot gnu.org @ 2013-03-13 14:46 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56614
           Summary: [4.7/4.8 Regression] error: default argument
                    'std::vector<E>(std::initializer_list<E>{((const E*)(&
                    ._0)), 1u}, (*(const std::allocator<E>*)(&
                    std::allocator<E>())))' uses local variable '._0'
    Classification: Unclassified
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


#include <initializer_list>

namespace std
{
    template<typename T>
        struct allocator
        { };

    template<typename T, typename Alloc = std::allocator<T> >
        struct vector
        {
            vector(std::initializer_list<T>, const Alloc& = Alloc()) { }
        };
}

void func() { }

enum E { ee };

struct C
{
    template<typename T>
        C(T, std::vector<E> = std::vector<E>({ ee }))
        { }
};

struct G
{
    void gen()
    {
        C c(&func);
    }
};


$ g++ -std=c++11 err.cc
err.cc: In constructor 'C::C(T, std::vector<E>) [with T = void (*)()]':
err.cc:31:18: error: default argument
'std::vector<E>(std::initializer_list<E>{((const E*)(& ._0)), 1u}, (*(const
std::allocator<E>*)(& std::allocator<E>())))' uses local variable '._0'
         C c(&func);
                  ^


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

end of thread, other threads:[~2013-03-14 17:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-13 14:46 [Bug c++/56614] New: [4.7/4.8 Regression] error: default argument 'std::vector<E>(std::initializer_list<E>{((const E*)(& ._0)), 1u}, (*(const std::allocator<E>*)(& std::allocator<E>())))' uses local variable '._0' redi at gcc dot gnu.org
2013-03-13 16:48 ` [Bug c++/56614] " paolo.carlini at oracle dot com
2013-03-13 17:29 ` paolo.carlini at oracle dot com
2013-03-13 17:37 ` redi at gcc dot gnu.org
2013-03-14 10:22 ` jakub at gcc dot gnu.org
2013-03-14 13:09 ` jason at gcc dot gnu.org
2013-03-14 17:35 ` jason at gcc dot gnu.org
2013-03-14 17:36 ` jason at gcc dot gnu.org
2013-03-14 17:46 ` redi 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).