public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67838] New: Rejects-valid-code: templated lambda variable.
@ 2015-10-04 12:31 bisqwit at iki dot fi
  2015-10-04 12:41 ` [Bug c++/67838] " bisqwit at iki dot fi
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bisqwit at iki dot fi @ 2015-10-04 12:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67838
           Summary: Rejects-valid-code: templated lambda variable.
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bisqwit at iki dot fi
  Target Milestone: ---

GCC 5.2 fails to compile the code below, erroneously citing "error: use of
'TestFunc<false>' before deduction of 'auto'".
Compiles fine in Clang 3.5.

#include <stdio.h>

template<bool LMode>
static auto TestFunc = [](int param1)
{
    return param1;
};

template<typename Func>
static void test(Func func)
{
    printf("%d\n", func(12345));
}

int main()
{
    test(TestFunc<false>);
    test(TestFunc<true>);
}


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

end of thread, other threads:[~2015-10-22 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-04 12:31 [Bug c++/67838] New: Rejects-valid-code: templated lambda variable bisqwit at iki dot fi
2015-10-04 12:41 ` [Bug c++/67838] " bisqwit at iki dot fi
2015-10-04 12:51 ` trippels at gcc dot gnu.org
2015-10-22 14:50 ` paolo.carlini at oracle dot com
2015-10-22 14:55 ` paolo at gcc dot gnu.org
2015-10-22 14:56 ` paolo.carlini at oracle 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).