Bug ID: 77655
           Summary: ICE on invalid c++ code on x86_64-linux-gnu (internal
                    compiler error: Segmentation fault (program cc1plus))
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot
          Reporter: chengniansun at gmail dot com
  Target Milestone: ---

$ gcc-trunk -v
Using built-in specs.
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160919 (experimental) [trunk revision 240232] (GCC) 
$ gcc-trunk small.C
small.C: In instantiation of ‘decltype (g(0, (g<decltype(h::a)>)(h::a)...))
h(A&& ...) [with A = {}; decltype (g(0, (g<decltype(h::a)>)(h::a)...)) = void;
decltype (a) = ]’:
small.C:8:5:   required from here
small.C:4:4: error: no matching function for call to ‘h(h(A&& ...) [with A =
{}; decltype (g(0, (g<decltype(h::a)>)(h::a)...)) = void; decltype (a) =
   h([] {});
small.C:3:6: note: candidate: template<class ... A> decltype (g(0,
(g<decltype(h::a)>)(h::a)...)) h(A&& ...)
 auto h(A &&... a) -> decltype(g(0, g<decltype(a)>(a)...)) {
small.C:3:6: note:   template argument deduction/substitution failed:
gcc-trunk: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <> for instructions.
$ cat small.C
template <class F> void g(F);
template <class... A>
auto h(A &&... a) -> decltype(g(0, g<decltype(a)>(a)...)) {
  h([] {});

int main() { 
  return 0; 

Reply via email to