diff --git a/infer/models/cpp/include/infer_model/vector.h b/infer/models/cpp/include/infer_model/vector.h index 50705bbdf..7985b059b 100644 --- a/infer/models/cpp/include/infer_model/vector.h +++ b/infer/models/cpp/include/infer_model/vector.h @@ -25,9 +25,6 @@ // libc++ vector header includes it, but it breaks // compilation with stdlibc++ implementation #include -#define _LIBCPP_VECTOR -#else -#define _GLIBCXX_VECTOR #endif INFER_NAMESPACE_STD_BEGIN diff --git a/infer/tests/codetoanalyze/cpp/bufferoverrun/folly_memory_UninitializedMemoryHacks.cpp b/infer/tests/codetoanalyze/cpp/bufferoverrun/folly_memory_UninitializedMemoryHacks.cpp index 151ddfe0b..9f0a1193b 100644 --- a/infer/tests/codetoanalyze/cpp/bufferoverrun/folly_memory_UninitializedMemoryHacks.cpp +++ b/infer/tests/codetoanalyze/cpp/bufferoverrun/folly_memory_UninitializedMemoryHacks.cpp @@ -1,10 +1,17 @@ /* - * Copyright (c) 2017 - present Facebook, Inc. - * All rights reserved. + * Copyright 2017 Facebook, Inc. * - * 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. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ #pragma once diff --git a/infer/tests/codetoanalyze/cpp/errors/vector/use_models_headers.cpp b/infer/tests/codetoanalyze/cpp/errors/vector/use_models_headers.cpp new file mode 100644 index 000000000..b12eb5089 --- /dev/null +++ b/infer/tests/codetoanalyze/cpp/errors/vector/use_models_headers.cpp @@ -0,0 +1,13 @@ +/* + * 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. + */ + +#include +#if defined(_LIBCPP_VECTOR) || defined(_GLIBCXX_VECTOR) +#error "infer should use models headers" +#endif