name: clang syntax checks
on:
  push:
    branches: [ master, development, pull-request/* ]
  pull_request:
    branches: [ master, pull-request/* ]

jobs:
  build-clang-cpp03-linux-STL:
    name: Syntax Check - Clang C++03 Linux STL
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=03 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp03-linux-No-STL:
    name: Syntax Check - Clang C++03 Linux No STL 
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=03 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp11-linux-STL:
    name: Syntax Check - Clang C++11 Linux STL
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=11 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp11-linux-No-STL:
    name: Syntax Check - Clang C++11 Linux No STL 
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=11 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp11-linux-STL-Force-CPP03:
    name: Syntax Check - Clang C++11 Linux STL Force C++03
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=11 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp11-linux-No-STL-Force-CPP03:
    name: Syntax Check - Clang C++11 Linux No STL Force C++03
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=11 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp14-linux-STL:
    name: Syntax Check - Clang C++14 Linux STL
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=14 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp14-linux-No-STL:
    name: Syntax Check - Clang C++14 Linux No STL 
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=14 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp14-linux-STL-Force-CPP03:
    name: Syntax Check - Clang C++14 Linux STL Force C++03
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=14 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp14-linux-No-STL-Force-CPP03:
    name: Syntax Check - Clang C++14 Linux No STL Force C++03
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=14 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp17-linux-STL:
    name: Syntax Check - Clang C++17 Linux STL
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=17 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp17-linux-No-STL:
    name: Syntax Check - Clang C++17 Linux No STL 
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=17 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp17-linux-STL-Force-CPP03:
    name: Syntax Check - Clang C++17 Linux STL Force C++03
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=17 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp17-linux-No-STL-Force-CPP03:
    name: Syntax Check - Clang C++17 Linux No STL Force C++03
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=17 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp20-linux-STL:
    name: Syntax Check - Clang C++20 Linux STL
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=20 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp20-linux-No-STL:
    name: Syntax Check - Clang C++20 Linux No STL 
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=20 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp20-linux-STL-Force-CPP03:
    name: Syntax Check - Clang C++20 Linux STL Force C++03
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=20 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp20-linux-No-STL-Force-CPP03:
    name: Syntax Check - Clang C++20 Linux No STL Force C++03
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=20 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp23-linux-STL:
    name: Syntax Check - Clang C++23 Linux STL
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=23 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp23-linux-No-STL:
    name: Syntax Check - Clang C++23 Linux No STL 
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=OFF -DETL_CXX_STANDARD=23 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp23-linux-STL-Force-CPP03:
    name: Syntax Check - Clang C++23 Linux STL Force C++03
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=OFF -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=23 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)

  build-clang-cpp23-linux-No-STL-Force-CPP03:
    name: Syntax Check - Clang C++23 Linux No STL Force C++03
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-22.04]

    steps:
    - uses: actions/checkout@v4

    - name: Build
      run: |
        export CC=clang
        export CXX=clang++
        cmake -DNO_STL=ON -DETL_USE_TYPE_TRAITS_BUILTINS=OFF -DETL_USER_DEFINED_TYPE_TRAITS=OFF -DETL_FORCE_TEST_CPP03_IMPLEMENTATION=ON -DETL_CXX_STANDARD=23 ./test/syntax_check
        clang --version
        make -j $(getconf _NPROCESSORS_ONLN)
