Error: conversion from ‘llvm::StringRef’ to non-scalar type ‘std::__cxx11::string’ {aka ‘std::__cxx11::basic_string<char>’} requested

/home/pegasus/Documents/LLVM_Rust/CCR-master/llvm/lib/MC/MCAssembler.cpp:1223:41: error: conversion from ‘llvm::StringRef’ to non-scalar type ‘std::__cxx11::string’ {aka ‘std::__cxx11::basic_string<char>’} requested
     std::string secName = ELFSec.getName();
                           ~~~~~~~~~~~~~~^~

I’m getting the following error.
How to remove it?

The definition of StringRef is in llvm/include/llvm/ADT/StringRef.h; it has methods for returning the data as a string.