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++/83204] New: [6/7/8 Regression] c++ -std=c++14 ICE in maybe_undo_parenthesized_ref, at cp/semantics.c:1694


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

            Bug ID: 83204
           Summary: [6/7/8 Regression] c++ -std=c++14 ICE in
                    maybe_undo_parenthesized_ref, at cp/semantics.c:1694
           Product: gcc
           Version: 7.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org
  Target Milestone: ---

[forwarded from https://bugs.debian.org/882855]

not seen with GCC 5, but with the 6, 7 branches and the trunk, not seen in
c++11 mode.

$ cat test.cpp
int rand();

template<typename T>
struct s
{
    int count() { return rand(); }
};

template<typename v>
int f(s<v> a)
{
    int const x = a.count();
    int r = 0;
    auto l = [&](int& r)
    {
        for(int y = 0, yend = (x); y < yend; ++y)
        {
            r += y;
        }
    };
    l(r);
}

template int f(s<float>);

int main()
{
}

$ g++ -std=c++14 -c test.cpp 
test.cpp: In instantiation of 'f(s<v>)::<lambda(int&)> [with v = float]':
test.cpp:14:16:   required from 'struct f(s<v>) [with v =
float]::<lambda(int&)>'
test.cpp:20:5:   required from 'int f(s<v>) [with v = float]'
test.cpp:24:24:   required from here
test.cpp:16:33: internal compiler error: in maybe_undo_parenthesized_ref, at
cp/semantics.c:1694
         for(int y = 0, yend = (x); y < yend; ++y)
                                 ^
Please submit a full bug report,
with preprocessed source if appropriate.

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