This is the mail archive of the gcc-bugs@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]

[Bug c++/67350] New: auto deduction error in variable template lambda


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67350

            Bug ID: 67350
           Summary: auto deduction error in variable template lambda
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: norbert.pfeiler+gcc.gnu.org/bugzilla at gmail dot com
  Target Milestone: ---

template<typename T>
auto test = [](){
    return T{};
};

int main() {
    test<int>();
}

error: use of 'test<int>' before deduction of 'auto'

Clang 3.6.2 acceptsâ

Iâm not exactly sure this code is valid, but i canât find much about variable
templates and lambdas.

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