Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/libclang/libclang_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,16 @@ bool is_absolute(const std::string& file)

std::string get_full_path(const detail::cxstring& dir, const std::string& file)
{
DEBUG_ASSERT(!dir.empty(), detail::precondition_error_handler{},
"Either file is absolute or relative to some named dir");
if (is_absolute(file))
// absolute file
return file;
else if (dir[dir.length() - 1] != '/' && dir[dir.length() - 1] != '\\')
// GCC fails to understand that the assertion would avoid reaching this line if dir was empty.
#if defined __GNUC__
# pragma GCC diagnostic ignored "-Warray-bounds"
#endif
if (dir[dir.length() - 1] != '/' && dir[dir.length() - 1] != '\\')
// relative needing separator
return dir.std_str() + '/' + file;
else
Expand Down