This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/58130] New: [C++11] Compilation fails using "const decltype(...)& getter() const {...}"
- From: "vittorio.romeo at outlook dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 11 Aug 2013 21:32:36 +0000
- Subject: [Bug c++/58130] New: [C++11] Compilation fails using "const decltype(...)& getter() const {...}"
- Auto-submitted: auto-generated
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(); }
}