From 6ff421ca65a6d8697cfef3d655d5225ef790909d Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Thu, 27 Apr 2017 07:25:28 -0700 Subject: [PATCH] [C++ models] Fix compilation issues with unique_ptr under gcc 5 Summary: `libstdc++` includes `bits/unique_ptr.h` via `include "unique_ptr.h"` in `bits/locale_conv.h` which infer can't redirect to model headers. This leads to compilation issues. To work around that, redirect include of `locale_conv.h` to include `unique_ptr` via `include <...>` before normal `locale_conv.h`. Reviewed By: mbouaziz Differential Revision: D4962314 fbshipit-source-id: d4b9830 --- infer/models/cpp/include/bits/locale_conv.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 infer/models/cpp/include/bits/locale_conv.h diff --git a/infer/models/cpp/include/bits/locale_conv.h b/infer/models/cpp/include/bits/locale_conv.h new file mode 100644 index 000000000..01387221b --- /dev/null +++ b/infer/models/cpp/include/bits/locale_conv.h @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2017 - present Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ +#pragma once + +// locale_conv in libstdc++ is including 'bits/unique_ptr.h' via +// #include "unique_ptr.h". Infer can't redirect those includes +// so instead include unique_ptr via our header first. Then, it +// won't be included again in 'bits/locale_conv.h' +#include + +#include_next