Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expected expression (ccls 4) when declaring a variable directly underneath case #950

Open
Zeebrow opened this issue Oct 1, 2023 · 0 comments

Comments

@Zeebrow
Copy link

Zeebrow commented Oct 1, 2023


Observed behavior

ccls is telling me that a variable declaration is not allowed underneath a case statement.
image

However, it is okay if the variable declaration comes after something like an if:
image

Expected behavior

There isn no error reported

Steps to reproduce

  int func(){  
      int a;  
      switch (a) {  
          case 1:
              if(1){}
              int b;
          case 2:
              int c;  // Expected expression (ccls 4)
      }                                                            
      return 0;                                                    
  }

System information

  • ccls version (git describe --tags --long):
$ ccls --version
Ubuntu ccls version 0.20210330-1
clang version 12.0.1-19ubuntu3
  • clang version:
$ clang --version
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
  • OS:
    22.04.3 LTS (Jammy Jellyfish)

  • Editor:

$ nvim --version
NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by [email protected]

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
  • Language client (and version):
vim version: NVIM v0.6.1
node version: v18.17.0
coc.nvim version: 0.0.82-3dc6153a 2023-07-21 00:22:17 -0500
coc.nvim directory: /home/zeebrow/.local/share/nvim/plugged/coc.nvim
term: xterm-256color
platform: linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant