LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 2919 - gcc regards struct foo and const struct foo as __builtin_types_compatible_p
Summary: gcc regards struct foo and const struct foo as __builtin_types_compatible_p
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: Frontend (show other bugs)
Version: unspecified
Hardware: All All
: P normal
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-18 21:18 PDT by Daniel Dunbar
Modified: 2010-03-12 00:57 PST (History)
2 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Dunbar 2008-10-18 21:18:53 PDT
gcc accepts the following code which clang rejects:
--
int a0[__builtin_types_compatible_p(struct foo, 
                                    const struct foo) ? 1 : -1];
--

Reported as problem compiling Dovecot.
Comment 1 Eli Friedman 2008-10-20 19:11:17 PDT
From the gcc docs for __builtin_types_compatible_p:

"This built-in function ignores top level qualifiers (e.g., const, volatile). For example, int is equivalent to const int."
Comment 2 Daniel Dunbar 2008-10-24 03:08:35 PDT
Fixed here: http://llvm.org/viewvc/llvm-project?view=rev&revision=58079