Commit c5310f12 authored by Christian Hergert's avatar Christian Hergert

clang: improve C++ detection

Related #1245
parent 650d6119
......@@ -116,10 +116,9 @@ is_cplusplus_param (const gchar *param)
if (g_str_has_prefix (param, "std="))
if (g_str_has_prefix (param, "std=") ||
g_str_has_prefix (param, "x="))
param += 4;
/* Assume + means C++ of some sort */
if (strchr (param, '+') != NULL)
return TRUE;
......@@ -230,6 +229,10 @@ ide_clang_cook_flags (const gchar *path,
/* Make sure we always include -xc++ if we think this is a C++ file */
if (!is_cplusplus && ide_path_is_cpp_like (path))
g_ptr_array_insert (cooked, pos++, g_strdup ("-xc++"));
/* Insert -Idirname as first include if we didn't find it in the list of
* include paths from the request. That ensures we have something that is
* very similar to what clang would do unless they specified the path
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment