Skip to content

libclang 5.0.2 does not parse correctly as 3.4.0 usually did. #7554

Closed

Description

@franzbischoff

System details

RStudio Edition : Desktop
RStudio Version : Version 1.3.1056
OS Version      :  Windows 10 x64 (build 18362)
R Version       :  3.6.3 (2020-02-29)

Steps to reproduce the problem

Create a new package project

install.packages("devtools")
devtools::install_github("r-lib/usethis")
install.packages("cpp11")

usethis::use_cpp11()

Create a new file at src/testfile.cpp

add this content:

#include "cpp11.hpp"
using namespace cpp11;
[[cpp11::register]]
double sum2(doubles x) {
  double total = 0;
  for(auto it = x.begin(); it != x.end(); ++it) {
    total += *it;
  }
  return total;
}

Describe the problem in detail

First, I think this issue may be relate to #6384 and/or #4457

I first reported the issue at r-lib issues link, and to avoid repetition, I ask you to look there what I reported.

But in synthesis: What I found is that libclang is not parsing correctly the namespaces and report for example that cpp11::doubles does not exist.
RStudio from 1.3 (IIRC) started to use libclang 5.0.2 (in order to allow c++14). In older versions (RStudio Desktop 1.1.463 version) it used the version 3.4.0, and libclang parses the headers correctly.

I also tested in Ubuntu 16.04 LTS, with the same problems (and the solutions also worked).

Using .rs.setClangDiagnostics(2) you can see that the current libclang throws errors parsing the headers.

What I did and worked:

  • In Ubuntu, I installed the lastest libclang (version 10 IIRC) and that still giving the same issues.
  • So I installed the old version 3.4.0, and the problem was solved.
  • In windows, I copied the libclang files from the old RStudio over the new RStudio, and the problem was solved.

Has this anything related to Rtools that is not prepared for the new libclang? or RStudio?

Thanks.

Describe the behavior you expected

  • The parsing being correct

Activity

  1. ronblum commented on Aug 13, 2020

    @ronblum
    Contributor

    @franzbischoff Thank you for raising the issue! I'll mark for review as part of our ongoing development of RStudio.

  2. franzbischoff commented on Dec 14, 2020

    @franzbischoff
    Author

    Just tried with a bunch of LLVM versions, 3.7.0 works.

    I see that clang is looking inside these folders:

    CLANG INDEXING: D:/Workspaces/RStudio/matrixprofiler/src/mass.cpp
    GENERATING PRECOMPILED HEADERS:
    [
        "-IC:/Program Files/RStudio/resources/libclang/builtin-headers/5.0.2",
        "-IC:/Program Files/RStudio/resources/libclang/builtin-headers/libc++/5.0.2",
        "-IC:/Users/Franz/AppData/Local/renv/cache/v5/R-4.0/x86_64-w64-mingw32/Rcpp/1.0.5/125dc7a0ed375eb68c0ce533b48d291f/Rcpp/include",
        "-IC:/Users/Franz/AppData/Local/renv/cache/v5/R-4.0/x86_64-w64-mingw32/RcppParallel/5.0.2/551d50addb18c7b99637aa377a25afc8/RcppParallel/include",
        "-IC:/Users/Franz/AppData/Local/renv/cache/v5/R-4.0/x86_64-w64-mingw32/RcppThread/0.5.4/36e1c538df6e0133891204aee0acdfc0/RcppThread/include",
        "-IC:/Users/Franz/AppData/Local/renv/cache/v5/R-4.0/x86_64-w64-mingw32/RcppProgress/0.4.2/1c0aa18b97e6aaa17f93b8b866c0ace5/RcppProgress/include",
        "-IC:/PROGRA~1/R/R-40~1.3/include",
        "-DNDEBUG",
        "-DRCPP_PARALLEL_USE_TBB=1",
        "-IC:/Users/Franz/AppData/Local/renv/cache/v5/R-4.0/x86_64-w64-mingw32/Rcpp/1.0.5/125dc7a0ed375eb68c0ce533b48d291f/Rcpp/include",
        "-std=gnu++11"
    ]
    

    But the weirdest thing is that <stdint.h> and <cstdint> are there in those folders, and even if I #include them in my file, libclang (new versions) still missing the intxx_t defines.

  3. R-Hannibal commented on Feb 12, 2021

    @R-Hannibal

    @kevinushey - do you think a libclang update on our end would address this issue?

  4. franzbischoff commented on Feb 12, 2021

    @franzbischoff
    Author

    After migrating from RStudio to VSCode (only for Rcpp purpose) and dealing with clang directly, I say that it is not a bug in clang, but some include path is not well referenced to clang parser by RStudio.

  5. kevinushey commented on Feb 16, 2021

    @kevinushey
    Collaborator

    The problem (IIUC) is that even though we're including the bundled libclang headers, we're not including the Rtools toolchain headers.

  6. franzbischoff commented on Feb 16, 2021

    @franzbischoff
    Author

    Right @kevinushey , the parser starts by not finding the stdlib functions/defines and stop by limit of errors.

  7. github-actions commented on Nov 27, 2021

    @github-actions

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs, per https://github.com/rstudio/rstudio/wiki/Issue-Grooming. Thank you for your contributions.

  8. added
    stale
    on Nov 27, 2021
  9. stale commented on Dec 11, 2021

    @stale

    This issue has been automatically closed due to inactivity.

  10. mikebessuille commented on Feb 7, 2022

    @mikebessuille
    Contributor

    Related to #10514

  11. 26 remaining items

  12. gtritchie commented on May 13, 2022

    @gtritchie
    Member

    For the testing I did above, I started with a clean Windows-10 VM, then installed R 4.1.3, RTools 4.0, and RStudio 2022.06.0-daily+403 (Qt).

    Then tried the repro steps from this issue, and let it install all the R packages it wanted.

    Then, on the same VM, I installed R 4.2.0 and RTools 4.2, started RStudio while holding down Ctrl and picked R 4.2, then had it load the same project, and re-ran the commands in the repro steps, e.g.:

    install.packages("devtools")
    devtools::install_github("r-lib/usethis")
    install.packages("cpp11")
    usethis::use_cpp11()
    

    Then I enabled clang diagnostics and saw the error.

  13. gtritchie commented on May 13, 2022

    @gtritchie
    Member

    Assigning back to @kevinushey, he said he'd like to take a look at this.

  14. gtritchie commented on May 23, 2022

    @gtritchie
    Member

    Tried the scenario again on a clean Windows-10 VM. Installed:

    • R 4.1.3
    • RTools 4.0
    • RStudio build 2022.06.0-daily+435 (Qt)

    Then in RStudio console:

    install.packages("devtools")
    devtools::install_github("r-lib/usethis")
    install.packages("cpp11")

    Then created a new package project, followed by:

    > usethis::use_cpp11()
    v Setting active project to 'C:/Users/gtritchie/Documents/repropackage'
    Error: Project 'repropackage' does not use roxygen2.
    `use_cpp11()` can not work without it.
    You might just need to run `devtools::document()` once, then try again.
    > 
    > 
    > devtools::document()
    i Updating repropackage documentation
    First time using roxygen2. Upgrading automatically...
    Setting `RoxygenNote` to "7.2.0"
    i Loading repropackage
    Warning message:
    Skipping NAMESPACE
    x It already exists and was not generated by roxygen2. 
    > usethis::use_cpp11()
    v Creating 'src/'
    v Adding '*.o', '*.so', '*.dll' to 'src/.gitignore'
    * Copy and paste the following lines into 'R/repropackage-package.R':
      ## usethis namespace: start
      #' @useDynLib repropackage, .registration = TRUE
      ## usethis namespace: end
      NULL
      [Copied to clipboard]
    v Adding 'cpp11' to LinkingTo field in DESCRIPTION
    v Adding 'C++11' to SystemRequirements field in DESCRIPTION
    v Writing 'src/code.cpp'
    * Modify 'src/code.cpp'
    * Now install 'decor' to use cpp11.
    > 
    > 
    Error in system(command, intern = TRUE) : '/mingw64/bin/gcc' not found
    Error in system(command, intern = TRUE) : '/mingw64/bin/g++' not found

    Note those error messages at the end. Not sure if they matter?

    Now I created the testfile.cpp with content as described in the repro steps. I did not see the problem originally described (no longer got the parsing error about unknown type name "doubles") and if I put in an intentional error, it was flagged.

    Then I turned on clang diagnostics, and here's what I saw:

    Attempting to load libclang for x86_64-w64-mingw32 
    C:/Program Files/RStudio/bin/rsclang/x86_64/libclang.dll
       LOADED: 13.0.1
    
    Restarting R session...
    
    CLANG INDEXING: C:/Users/gtritchie/Documents/repropackage/src/testfile.cpp
    # RESTORING PACKAGE COMPILATION CONFIG ----
    C:/Users/gtritchie/Documents/repropackage/.Rproj.user/4066BCE3/compilation-database/config.json
    {
        "args": [
            "-std=gnu++11",
            "-IC:/PROGRA~1/R/R-41~1.3/include",
            "-DNDEBUG",
            "-IC:/Users/gtritchie/Documents/R/win-library/4.1/cpp11/include",
            "-nostdinc",
            "-DEIGEN_DONT_VECTORIZE",
            "-IC:/rtools40/mingw64/include/c++/8.3.0",
            "-IC:/rtools40/mingw64/include/c++/8.3.0/x86_64-w64-mingw32",
            "-IC:/rtools40/mingw64/include/c++/8.3.0/backward",
            "-IC:/rtools40/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include",
            "-IC:/rtools40/mingw64/include",
            "-IC:/rtools40/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include-fixed",
            "-IC:/rtools40/mingw64/x86_64-w64-mingw32/include"
        ],
        "pch": "cpp11",
        "is_cpp": true,
        "hash": "1653346580",
        "compiler": "14695981039346656037",
        "rversion": "4.1.3",
        "dbversion": 1
    }
    
    # GENERATING PRECOMPILED HEADERS (cpp11) ----
    [
        "-IC:/Users/gtritchie/Documents/R/win-library/4.1/cpp11/include",
        "-IC:/PROGRA~1/R/R-41~1.3/include",
        "-DNDEBUG",
        "-IC:/Users/gtritchie/Documents/R/win-library/4.1/cpp11/include",
        "-nostdinc",
        "-DEIGEN_DONT_VECTORIZE",
        "-IC:/rtools40/mingw64/include/c++/8.3.0",
        "-IC:/rtools40/mingw64/include/c++/8.3.0/x86_64-w64-mingw32",
        "-IC:/rtools40/mingw64/include/c++/8.3.0/backward",
        "-IC:/rtools40/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include",
        "-IC:/rtools40/mingw64/include",
        "-IC:/rtools40/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include-fixed",
        "-IC:/rtools40/mingw64/x86_64-w64-mingw32/include",
        "-std=gnu++11"
    ]
    
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdio.h:167:63: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdio.h:170:68: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdio.h:173:86: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdio.h:176:91: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdio.h:179:86: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdio.h:182:91: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdio.h:185:87: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdio.h:188:92: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdlib.h:315:47: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdlib.h:316:48: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdlib.h:320:26: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdlib.h:610:69: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdlib.h:612:48: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\stdlib.h:613:55: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\process.h:32:40: error: expected ';' after top level declarator
    C:/rtools40/mingw64/x86_64-w64-mingw32/include\process.h:34:54: error: expected ';' after top level declarator
    C:/rtools40/mingw64/include/c++/8.3.0\bits/atomic_base.h:210:20: error: use of undeclared identifier '__GCC_ATOMIC_TEST_AND_SET_TRUEVAL'
    C:/rtools40/mingw64/include/c++/8.3.0\bits/atomic_base.h:209:5: error: no return statement in constexpr function
    # COMPILATION ARGUMENTS ----
    [
        "-std=gnu++11",
        "-IC:/PROGRA~1/R/R-41~1.3/include",
        "-DNDEBUG",
        "-IC:/Users/gtritchie/Documents/R/win-library/4.1/cpp11/include",
        "-nostdinc",
        "-DEIGEN_DONT_VECTORIZE",
        "-IC:/rtools40/mingw64/include/c++/8.3.0",
        "-IC:/rtools40/mingw64/include/c++/8.3.0/x86_64-w64-mingw32",
        "-IC:/rtools40/mingw64/include/c++/8.3.0/backward",
        "-IC:/rtools40/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include",
        "-IC:/rtools40/mingw64/include",
        "-IC:/rtools40/mingw64/lib/gcc/x86_64-w64-mingw32/8.3.0/include-fixed",
        "-IC:/rtools40/mingw64/x86_64-w64-mingw32/include",
        "-include-pch",
        "C:/Users/GTRITC~1/AppData/Local/Temp/Rtmpcny4Aw/rstudio/libclang/precompiled/cpp11/67538C19/0.4.2-x86_64-w64-mingw32-81868-13.0.1/cpp11-std=gnu++11.pch",
        "-v"
    ]
    
  15. kevinushey commented on May 23, 2022

    @kevinushey
    Collaborator

    Error in system(command, intern = TRUE) : '/mingw64/bin/gcc' not found
    Error in system(command, intern = TRUE) : '/mingw64/bin/g++' not found

    This is probably coming from here:

    # use the default compiler configured by R
    exe <- if (.rs.platform.isWindows) "R.exe" else "R"
    R <- file.path(R.home("bin"), exe)
    compiler <- if (isCpp) "CXX" else "CC"
    cxx <- system2(R, c("CMD", "config", compiler), stdout = TRUE, stderr = TRUE)

    I think we need to handle this specially for Rtools40.

    > r <- file.path(R.home("bin"), "R.exe")
    > system2(r, "CMD config CC")
    /mingw32/bin/gcc
    > system2(r, "CMD config CXX")
    /mingw32/bin/g++ -std=gnu++11
    

    (Those paths are only real within a MinGW shell; we should instead just use gcc.exe and g++.exe explicitly after ensuring Rtools is on the PATH.)

    The other compiler warnings, I suspect, are another case of where we need to tell libclang to "pretend" to be gcc instead of MSVC.

  16. kevinushey commented on May 26, 2022

    @kevinushey
    Collaborator

    To spare @gtritchie from testing this once again, I verified this now works as expected with:

    • R 4.1.3 (32-bit)
    • Rtools40 (32-bit)
    • RStudio 2022.06.0 Build 452 (Qt)

    For posterity:

    CLANG INDEXING: C:/Users/kevin/scratch/uses.cpp11/src/code.cpp
    # RESTORING PACKAGE COMPILATION CONFIG ----
    C:/Users/kevin/scratch/uses.cpp11/.Rproj.user/CF673E8F/compilation-database/mingw32/config.json
    {
        "args": [
            "-std=gnu++11",
            "-IC:/R/R-41~1.3/include",
            "-DNDEBUG",
            "-IC:/R/R-4.1.3/library/cpp11/include",
            "-nostdinc",
            "-DEIGEN_DONT_VECTORIZE",
            "-U_MSC_VER",
            "-D__GNUC__=8",
            "-D__GNUC_MINOR__=3",
            "-D__GNUC_PATCHLEVEL__=0",
            "-IC:/rtools40/mingw32/include/c++/8.3.0",
            "-IC:/rtools40/mingw32/include/c++/8.3.0/i686-w64-mingw32",
            "-IC:/rtools40/mingw32/include/c++/8.3.0/backward",
            "-IC:/rtools40/mingw32/lib/gcc/i686-w64-mingw32/8.3.0/include",
            "-IC:/rtools40/mingw32/include",
            "-IC:/rtools40/mingw32/lib/gcc/i686-w64-mingw32/8.3.0/include-fixed",
            "-IC:/rtools40/mingw32/i686-w64-mingw32/include",
            "-include",
            "C:/Users/kevin/scratch/uses.cpp11/.Rproj.user/CF673E8F/compilation-database/mingw32/cpp-definitions.h"
        ],
        "pch": "cpp11",
        "is_cpp": true,
        "hash": "1653592233",
        "compiler": "2166136261",
        "rversion": "4.1.3",
        "dbversion": 1
    }
    
    # GENERATING PRECOMPILED HEADERS (cpp11) ----
    [
        "-IC:/R/R-4.1.3/library/cpp11/include",
        "-IC:/R/R-41~1.3/include",
        "-DNDEBUG",
        "-IC:/R/R-4.1.3/library/cpp11/include",
        "-nostdinc",
        "-DEIGEN_DONT_VECTORIZE",
        "-U_MSC_VER",
        "-D__GNUC__=8",
        "-D__GNUC_MINOR__=3",
        "-D__GNUC_PATCHLEVEL__=0",
        "-IC:/rtools40/mingw32/include/c++/8.3.0",
        "-IC:/rtools40/mingw32/include/c++/8.3.0/i686-w64-mingw32",
        "-IC:/rtools40/mingw32/include/c++/8.3.0/backward",
        "-IC:/rtools40/mingw32/lib/gcc/i686-w64-mingw32/8.3.0/include",
        "-IC:/rtools40/mingw32/include",
        "-IC:/rtools40/mingw32/lib/gcc/i686-w64-mingw32/8.3.0/include-fixed",
        "-IC:/rtools40/mingw32/i686-w64-mingw32/include",
        "-include",
        "C:/Users/kevin/scratch/uses.cpp11/.Rproj.user/CF673E8F/compilation-database/mingw32/cpp-definitions.h",
        "-std=gnu++11"
    ]
    
    # COMPILATION ARGUMENTS ----
    [
        "-std=gnu++11",
        "-IC:/R/R-41~1.3/include",
        "-DNDEBUG",
        "-IC:/R/R-4.1.3/library/cpp11/include",
        "-nostdinc",
        "-DEIGEN_DONT_VECTORIZE",
        "-U_MSC_VER",
        "-D__GNUC__=8",
        "-D__GNUC_MINOR__=3",
        "-D__GNUC_PATCHLEVEL__=0",
        "-IC:/rtools40/mingw32/include/c++/8.3.0",
        "-IC:/rtools40/mingw32/include/c++/8.3.0/i686-w64-mingw32",
        "-IC:/rtools40/mingw32/include/c++/8.3.0/backward",
        "-IC:/rtools40/mingw32/lib/gcc/i686-w64-mingw32/8.3.0/include",
        "-IC:/rtools40/mingw32/include",
        "-IC:/rtools40/mingw32/lib/gcc/i686-w64-mingw32/8.3.0/include-fixed",
        "-IC:/rtools40/mingw32/i686-w64-mingw32/include",
        "-include",
        "C:/Users/kevin/scratch/uses.cpp11/.Rproj.user/CF673E8F/compilation-database/mingw32/cpp-definitions.h",
        "-include-pch",
        "C:/Users/kevin/AppData/Local/Temp/Rtmp61oO21/rstudio/libclang/precompiled/cpp11/4AB97FAB/0.4.2-i386-w64-mingw32-81868-13.0.1/cpp11-std=gnu++11.pch",
        "-v"
    ]
      (Creating new index)
    clang version 13.0.1
    Target: i686-pc-windows-msvc
    Thread model: posix
    InstalledDir: 
    #include "..." search starts here:
    #include <...> search starts here:
     C:/R/R-41~1.3/include
     C:/R/R-4.1.3/library/cpp11/include
     C:/rtools40/mingw32/include/c++/8.3.0
     C:/rtools40/mingw32/include/c++/8.3.0/i686-w64-mingw32
     C:/rtools40/mingw32/include/c++/8.3.0/backward
     C:/rtools40/mingw32/lib/gcc/i686-w64-mingw32/8.3.0/include
     C:/rtools40/mingw32/include
     C:/rtools40/mingw32/lib/gcc/i686-w64-mingw32/8.3.0/include-fixed
     C:/rtools40/mingw32/i686-w64-mingw32/include
    End of search list.
    TOTAL MEMORY: 7 mb (code.cpp)
    PERFORMANCE 1003 ms (code.cpp)
    

    And, with:

    • R 4.2.0 (64-bit)
    • Rtools42 (64-bit)
    • RStudio 2022.06.0 Build 452 (Qt)

    I see:

    LANG INDEXING: C:/Users/kevin/scratch/uses.cpp11/src/code.cpp
    PACKAGE PCH: cpp11
    # SAVING PACKAGE COMPILATION CONFIG ----
    C:/Users/kevin/scratch/uses.cpp11/.Rproj.user/CF673E8F/compilation-database/mingw64/config.json
    {
        "args": [
            "-std=c++11",
            "-IC:/R/R-42~1.0/include",
            "-DNDEBUG",
            "-IC:/R/R-4.2.0/library/cpp11/include",
            "-nostdinc",
            "-DEIGEN_DONT_VECTORIZE",
            "-U_MSC_VER",
            "-D__GNUC__=10",
            "-D__GNUC_MINOR__=3",
            "-D__GNUC_PATCHLEVEL__=0",
            "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++",
            "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++/x86_64-w64-mingw32.static.posix",
            "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++/backward",
            "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include",
            "-IC:/rtools42/x86_64-w64-mingw32.static.posix/include",
            "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include-fixed",
            "-include",
            "C:/Users/kevin/scratch/uses.cpp11/.Rproj.user/CF673E8F/compilation-database/mingw64/cpp-definitions.h"
        ],
        "pch": "cpp11",
        "is_cpp": true,
        "hash": "1653592233",
        "compiler": "290264439608276909",
        "rversion": "4.2.0",
        "dbversion": 1
    }
    
    # GENERATING PRECOMPILED HEADERS (cpp11) ----
    [
        "-IC:/R/R-4.2.0/library/cpp11/include",
        "-IC:/R/R-42~1.0/include",
        "-DNDEBUG",
        "-IC:/R/R-4.2.0/library/cpp11/include",
        "-nostdinc",
        "-DEIGEN_DONT_VECTORIZE",
        "-U_MSC_VER",
        "-D__GNUC__=10",
        "-D__GNUC_MINOR__=3",
        "-D__GNUC_PATCHLEVEL__=0",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++/x86_64-w64-mingw32.static.posix",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++/backward",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/include",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include-fixed",
        "-include",
        "C:/Users/kevin/scratch/uses.cpp11/.Rproj.user/CF673E8F/compilation-database/mingw64/cpp-definitions.h",
        "-std=c++11"
    ]
    
    # COMPILATION ARGUMENTS ----
    [
        "-std=c++11",
        "-IC:/R/R-42~1.0/include",
        "-DNDEBUG",
        "-IC:/R/R-4.2.0/library/cpp11/include",
        "-nostdinc",
        "-DEIGEN_DONT_VECTORIZE",
        "-U_MSC_VER",
        "-D__GNUC__=10",
        "-D__GNUC_MINOR__=3",
        "-D__GNUC_PATCHLEVEL__=0",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++/x86_64-w64-mingw32.static.posix",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++/backward",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/include",
        "-IC:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include-fixed",
        "-include",
        "C:/Users/kevin/scratch/uses.cpp11/.Rproj.user/CF673E8F/compilation-database/mingw64/cpp-definitions.h",
        "-include-pch",
        "C:/Users/kevin/AppData/Local/Temp/RtmpCCQgu5/rstudio/libclang/precompiled/cpp11/085E4E56/0.4.2-x86_64-w64-mingw32-82229-13.0.1/cpp11-std=c++11.pch",
        "-v"
    ]
      (Creating new index)
    clang version 13.0.1
    Target: x86_64-pc-windows-msvc
    Thread model: posix
    InstalledDir: 
    #include "..." search starts here:
    #include <...> search starts here:
     C:/R/R-42~1.0/include
     C:/R/R-4.2.0/library/cpp11/include
     C:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++
     C:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++/x86_64-w64-mingw32.static.posix
     C:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include/c++/backward
     C:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include
     C:/rtools42/x86_64-w64-mingw32.static.posix/include
     C:/rtools42/x86_64-w64-mingw32.static.posix/lib/gcc/x86_64-w64-mingw32.static.posix/10.3.0/include-fixed
    End of search list.
    TOTAL MEMORY: 8 mb (code.cpp)
    PERFORMANCE 4848 ms (code.cpp)
    

    and code completion + diagnostics all appear to work as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions