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++/69277] New: ICE (Segmentation fault) used but never defined


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

            Bug ID: 69277
           Summary: ICE (Segmentation fault) used but never defined
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jan.smets@alcatel-lucent.com
  Target Milestone: ---

$GCC -fpreprocessed -S -xc++ -c testcase.best  -o /dev/null -mabi=64 (mips64
cross compiler was used) 

testcase.best:14:52: warning: '{anonymous}::unique_ptr<T>
{anonymous}::make_unique(Args&&) [with T = {anonymous}::DataContainerBinary;
Args = char (&)[]]' used but never defined
 template <typename T, typename Args> unique_ptr<T> make_unique(Args &&);
                                                    ^~~~~~~~~~~

testcase.best: In instantiation of '{anonymous}::unique_ptr<T>
{anonymous}::make_unique(Args&&) [with T = {anonymous}::DataContainerBinary;
Args = char (&)[]]':

testcase.best:14:52: internal compiler error: Segmentation fault



testcase.best :


namespace {
template <typename> class unique_ptr {};
class DataContainerBinary;
namespace {
struct BinaryValue;
union FieldValue {
  BinaryValue *binary;
};
struct BinaryValue {
  int length;
  char data[];
};
}
template <typename T, typename Args> unique_ptr<T> make_unique(Args &&);
namespace {
unique_ptr<DataContainerBinary> to_binary(FieldValue field) {
  make_unique<DataContainerBinary>(field.binary->data);
}
}
}

And if you change do this it warning output changes slightly (probably same
issue)

16c14
< template <typename T, typename Args> unique_ptr<T> make_unique(Args &&) {}
---
> template <typename T, typename Args> unique_ptr<T> make_unique(Args &&);

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