public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58130] New: [C++11] Compilation fails using "const decltype(...)& getter() const {...}"
@ 2013-08-11 21:32 vittorio.romeo at outlook dot com
  2013-08-11 21:33 ` [Bug c++/58130] " vittorio.romeo at outlook dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: vittorio.romeo at outlook dot com @ 2013-08-11 21:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58130
           Summary: [C++11] Compilation fails using "const decltype(...)&
                    getter() const {...}"
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vittorio.romeo at outlook dot com

Tested both on Windows 8 x86 and Arch Linux x64.
Compiling with "-O3 -Wall -Wextra -pedantic"

    struct myStruct
    {
        std::vector<std::unique_ptr<ItemBase>> items;
        ...

    // This compiles with g++ 4.8.2 and clang++ 3.4
    inline const std::vector<std::unique_ptr<ItemBase>>& getItems() const    {
return category->getItems(); }

    // This DOES NOT compile with g++ 4.8.2, but compiles with clang++ 3.4
    inline const decltype(items)& getItems() const    { return
category->getItems(); }

    }


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

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

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-11 21:32 [Bug c++/58130] New: [C++11] Compilation fails using "const decltype(...)& getter() const {...}" vittorio.romeo at outlook dot com
2013-08-11 21:33 ` [Bug c++/58130] " vittorio.romeo at outlook dot com
2013-08-11 21:52 ` paolo.carlini at oracle dot com
2013-08-17 14:03 ` vittorio.romeo at outlook dot com

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).