[llvm-bugs] [Bug 48799] New: Clang rejects both "const" and "const*" as type-name inside _Generic
via llvm-bugs
llvm-bugs at lists.llvm.org
Tue Jan 19 03:19:49 PST 2021
https://bugs.llvm.org/show_bug.cgi?id=48799
Bug ID: 48799
Summary: Clang rejects both "const" and "const*" as type-name
inside _Generic
Product: clang
Version: 11.0
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: C
Assignee: unassignedclangbugs at nondot.org
Reporter: cuoq at trust-in-soft.com
CC: blitzrakete at gmail.com, dgregor at apple.com,
erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
The _Generic construction expects a type-name in each association:
https://cigix.me/c17#6.5.1.1.p1
It seems to me and to GCC that "const" and "const*" are type-name
(https://cigix.me/c17#6.7.7.p1 )
However, Clang rejects each of the last two lines of the following function
with the message “error: expected a type”.
int main(void) {
const x = sizeof (const) + _Alignof ( const );
const *p = &(const){1};
_Generic(x, const :1,int:2);
_Generic(&x, const *:3,int*:4);
}
Compiler Explorer link: https://gcc.godbolt.org/z/8aYec8
--
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/20210119/5736ef7f/attachment.html>
More information about the llvm-bugs
mailing list