[llvm-bugs] [Bug 25430] New: Crush on choosing operator () of parent lambda in derived class
via llvm-bugs
llvm-bugs at lists.llvm.org
Fri Nov 6 02:39:45 PST 2015
https://llvm.org/bugs/show_bug.cgi?id=25430
Bug ID: 25430
Summary: Crush on choosing operator () of parent lambda in
derived class
Product: clang
Version: 3.7
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: unassignedclangbugs at nondot.org
Reporter: tomilovanatoliy at gmail.com
CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
Classification: Unclassified
Code:
#include <iostream>
#include <type_traits>
#include <cstdlib>
template< bool condition >
void
f()
{
auto static_if = [] (auto... l)
{
struct S : std::decay_t< decltype(l) >...
{
//using std::decay_t< decltype(l) >::operator ();
S(decltype(l)... _l) : std::decay_t< decltype(l) >{_l}... { ; }
} s{l...};
return s;
};
static_if([] (std::true_type) { std::cout << 1 << std::endl; }, []
(std::false_type) { std::cout << 2 << std::endl; })(std::integral_constant<
bool, condition >{});
}
int
main()
{
f< true >();
f< false >();
return EXIT_SUCCESS;
}
Build command:
clang++ -std=gnu++1z -stdlib=libc++ -O3 -Wall -Wextra -Weverything -pedantic
-Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-c++98-compat main.cpp -o
a.out && ./a.out
Error message:
clang: error: unable to execute command: Segmentation fault (core dumped)
clang: error: clang frontend command failed due to signal (use -v to see
invocation)
clang version 3.7.0 (tags/RELEASE_370/final 246979)
Target: x86_64-unknown-linux-gnu
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to
http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and
associated run script.
clang: note: diagnostic msg:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/main-1305dd.cpp
clang: note: diagnostic msg: /tmp/main-1305dd.sh
clang: note: diagnostic msg:
********************
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20151106/f85899d5/attachment.html>
More information about the llvm-bugs
mailing list