Skip to content
Open
Show file tree
Hide file tree
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
30 changes: 30 additions & 0 deletions .github/workflows/gcc-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# the purpose of this github action is to test that simplecpp source code can be compiled using old gcc versions.
# the gcc images we use here are copied from the official gcc images on docker hub

name: gcc-versions

on: [push, pull_request]

permissions:
contents: read

jobs:
build:

strategy:
matrix:
#image: ["ghcr.io/cppcheck-opensource/gcc:5.4", "ghcr.io/cppcheck-opensource/gcc:6.5", "ghcr.io/cppcheck-opensource/gcc:7.5", "ghcr.io/cppcheck-opensource/gcc:8.5", "ghcr.io/cppcheck-opensource/gcc:9.5"]
image: ["ghcr.io/cppcheck-opensource/gcc:5.4"]
fail-fast: false

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Build and run tests
run: |
docker run --rm -v ${{ github.workspace }}:/simplecpp -w /simplecpp ${{ matrix.image }} make -j$(nproc) simplecpp testrunner
docker run --rm -v ${{ github.workspace }}:/simplecpp -w /simplecpp ${{ matrix.image }} ./testrunner
4 changes: 2 additions & 2 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3131,8 +3131,8 @@ simplecpp::FileDataCache::FileDataCache()
{}

simplecpp::FileDataCache::~FileDataCache() = default;
simplecpp::FileDataCache::FileDataCache(FileDataCache &&) noexcept = default;
simplecpp::FileDataCache &simplecpp::FileDataCache::operator=(simplecpp::FileDataCache &&) noexcept = default;
simplecpp::FileDataCache::FileDataCache(FileDataCache &&) SIMPLECPP_NOEXCEPT = default;
simplecpp::FileDataCache &simplecpp::FileDataCache::operator=(simplecpp::FileDataCache &&) SIMPLECPP_NOEXCEPT = default;

static bool getFileId(const std::string &path, FileID &id);

Expand Down
13 changes: 11 additions & 2 deletions simplecpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@
# endif
#endif

#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 9
// Hack to workaround GCC bug.
// Details: https://trac.cppcheck.net/ticket/14850
// seen on g++ before 10.x
#define SIMPLECPP_NOEXCEPT
#else
#define SIMPLECPP_NOEXCEPT noexcept
#endif

namespace simplecpp {
/** C code standard */
enum cstd_t : std::int8_t { CUnknown=-1, C89, C99, C11, C17, C23, C2Y };
Expand Down Expand Up @@ -454,10 +463,10 @@ namespace simplecpp {
~FileDataCache();

FileDataCache(const FileDataCache &) = delete;
FileDataCache(FileDataCache &&) noexcept;
FileDataCache(FileDataCache &&) SIMPLECPP_NOEXCEPT;

FileDataCache &operator=(const FileDataCache &) = delete;
FileDataCache &operator=(FileDataCache &&) noexcept;
FileDataCache &operator=(FileDataCache &&) SIMPLECPP_NOEXCEPT;

/** Get the cached data for a file, or load and then return it if it isn't cached.
* returns the file data and true if the file was loaded, false if it was cached. */
Expand Down
Loading