dense-analysis / dense-analysis/ale

Can't parse Makefile when you have a *.cpp or **.cpp in it

Open
#3,824 0 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

## Information
NVIM v0.5.0
Build type: Release
Operating System: Arch Linux (5.12.13-arch1-2)

## What went wrong
The option **let g:ale_c_parse_makefile = 1** doesn't work when I have a ***.cpp** or ****.cpp** in the Makefile.

## Reproducing the bug
main.cpp (only compiles in C++17)
```
#include
#include

template
struct Overloader : Ts... {
using Ts::operator()...;
};

template
Overloader(T...) -> Overloader;

int main() {
auto o = Overloader{ [] (auto const& a) {std::cout << a;},
[] (float f) {std::cout << std::setprecision(3) << f;} };
}
```
makefile
```
compile: main.cpp
clang++ -std=c++17 -o bin *.cpp

run: compile
./bin
```

### :ALEInfo

```

Current Filetype: cpp
Available Linters: ['cc', 'ccls', 'clangcheck', 'clangd', 'clangtidy', 'clazy', 'cppcheck', 'cpplint', 'cquery', 'flawfinder']
Linter Aliases:
'cc' -> ['gcc', 'clang', 'g++', 'clang++']
Enabled Linters: ['cc']
Ignored Linters: []
Suggested Fixers:
'astyle' - Fix C/C++ with astyle.
'clang-format' - Fix C/C++ and cuda files with clang-format.
'clangtidy' - Fix C/C++ and ObjectiveC files with clang-tidy.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
'uncrustify' - Fix C, C++, C#, ObjectiveC, ObjectiveC++, D, Java, Pawn, and VALA files with uncrustify.
Linter Variables:

let g:ale_cpp_cc_executable = ''
let g:ale_cpp_cc_options = ''
Global Variables:

let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
let g:ale_disable_lsp = 0
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let g:ale_fix_on_save = 0
let g:ale_fixers = {}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {'cpp': ['clang']}
let g:ale_linters_explicit = 0
let g:ale_linters_ignore = {}
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:

(executable check - success) clang++
(finished - exit code 0) ['/bin/bash', '-c', 'cd ''/home/user/.locker/cloud/code/test'' && make -n --always-make']

<<>>
clang++ -std=c++17 -o bin *.cpp
<<>>

(finished - exit code 1) ['/bin/bash', '-c', 'cd ''/home/user/.locker/cloud/code/test'' && ''clang++'' -S -x c++ -o /dev/null -iquote ''/home/user/.locker/cloud/code/test'' - < ''/tmp/nvimimJ1qM/2/main.cpp''']

<<>>
:6:28: warning: pack expansion of using declaration is a C++17 extension [-Wc++17-extensions]
using Ts::operator()...;
^
:10:1: error: C++ requires a type specifier for all declarations
Overloader(T...) -> Overloader;
^
:13:14: error: use of class template 'Overloader' requires template arguments
auto o = Overloader{ [] (auto const& a) {std::cout << a;},
^
:5:8: note: template is declared here
struct Overloader : Ts... {
^
1 warning and 2 errors generated.
<<>>

```
![2021-07-16_19-31](https://user-images.githubusercontent.com/81699867/126014996-2e73a795-a6ba-43ab-8222-9be550a6a871.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.