public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67041] New: [C++14] Variable template initialized by call to lambda does not compile
@ 2015-07-28  5:45 ldionne.2 at gmail dot com
  2015-07-28  9:43 ` [Bug c++/67041] " redi at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ldionne.2 at gmail dot com @ 2015-07-28  5:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67041
           Summary: [C++14] Variable template initialized by call to
                    lambda does not compile
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ldionne.2 at gmail dot com
  Target Milestone: ---

The following code does not compile on GCC trunk:

-------------------------------
template <typename ...Anything>
auto variable_template = [] { return 1; }();

int main() {
    variable_template<>;
}
-------------------------------

The error is 

---------------------------------
prog.cc: In instantiation of 'auto variable_template<>':
prog.cc:5:5:   required from here
prog.cc:2:42: error: use of 'variable_template<>' before deduction of 'auto'
 auto variable_template = [] { return 1; }();
                                          ^
prog.cc:2:42: error: use of '<lambda()> [with Anything = {}]' before deduction
of 'auto'
---------------------------------

Live example: http://melpon.org/wandbox/permlink/srH8coYkvigwJSkb

Note that Clang compiles this code fine.


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

end of thread, other threads:[~2015-09-08 20:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-28  5:45 [Bug c++/67041] New: [C++14] Variable template initialized by call to lambda does not compile ldionne.2 at gmail dot com
2015-07-28  9:43 ` [Bug c++/67041] " redi at gcc dot gnu.org
2015-08-26 19:02 ` ldionne.2 at gmail dot com
2015-09-08 19:19 ` jason at gcc dot gnu.org
2015-09-08 19:34 ` jason at gcc dot gnu.org
2015-09-08 20:39 ` 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).