https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126102
Bug ID: 126102
Summary: [diagnostics] slightly noisy output when combining op.
overloading and macro expansion
Product: gcc
Version: 16.1.0
Status: UNCONFIRMED
Keywords: diagnostic
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: arsen at gcc dot gnu.org
CC: dmalcolm at gcc dot gnu.org
Target Milestone: ---
I noticed:
In file included from ../../gcc/gcc/cp/call.cc:30:
../../gcc/gcc/cp/call.cc: In function ‘conversion* reference_binding(tree,
tree, tree, bool, int, tsubst_flags_t)’:
../../gcc/gcc/cp/cp-tree.h:2567:26: error: no match for ‘operator&’ (operand
types are ‘qualifier_set’ and ‘cv_qualifier’)
2567 | ((cp_type_quals (NODE) & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE))
\
| ~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| qualifier_set cv_qualifier
../../gcc/gcc/cp/call.cc:2026:16: note: in expansion of macro
‘CP_TYPE_CONST_NON_VOLATILE_P’
2026 | && (!CP_TYPE_CONST_NON_VOLATILE_P (to)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
• there are 5 candidates
../../gcc/gcc/cp/cp-tree.h:2567:26:
2567 | ((cp_type_quals (NODE) & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE))
\
| ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
• in expansion of macro ‘CP_TYPE_CONST_NON_VOLATILE_P’
2026 | && (!CP_TYPE_CONST_NON_VOLATILE_P (to)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
... where the same source locations are cited twice.
reduced example:
struct T {};
bool operator& (T, T);
struct S {};
#define thing(X) ((X) & (X))
void
f (S &s)
{ thing (s); }
this feels noisier than needed