[llvm-bugs] [Bug 43961] New: clang misses the expected identifier error
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon Nov 11 04:18:26 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=43961
Bug ID: 43961
Summary: clang misses the expected identifier error
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: tangyixuan at mail.dlut.edu.cn
CC: llvm-bugs at lists.llvm.org, neeilans at live.com,
richard-llvm at metafoo.co.uk
The following code misses the function name in the function declaration. Clang
does not issue expected identifier instead of the fowing warnings or errors.
$: cat s.c
typedef int int32_t;
static const int32_t (int32_t a);
$: clang -Weverything -pedantic -ferror-limit=0 -c s.c
s.c:2:31: error: expected ')'
static const int32_t (int32_t a);
^
s.c:2:22: note: to match this '('
static const int32_t (int32_t a);
^
s.c:2:22: warning: redundant parentheses surrounding declarator
[-Wredundant-parens]
static const int32_t (int32_t a);
^~~~~~~~~~~
s.c:2:23: error: redefinition of 'int32_t' as different kind of symbol
static const int32_t (int32_t a);
^
s.c:1:13: note: previous definition is here
typedef int int32_t;
^
1 warning and 2 errors generated.
$: clang-trunk -v
clang version 10.0.0 (https://github.com/llvm/llvm-project.git
49c4e58b75ecec8dce75dd13c61aaeb30e14b531)
Target: x86_64-unknown-linux-gnu
Thread model: posix
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191111/884b6b4b/attachment-0001.html>
More information about the llvm-bugs
mailing list