Commit Graph

226866 Commits

Author SHA1 Message Date
Jakub Jelinek
ade2d7ca8b Move some strip_typedefs calls earlier. 2026-01-14 11:01:08 -05:00
Jakub Jelinek
29c610e1df Drop eval_is_type checks before calling eval_is_function_type.
This isn't needed after https://forge.sourceware.org/marek/gcc/commit/34293549c7c3
because it is process_metafunction which throws for is_function_type,
not eval_is_function_type, and the latter just returns boolean_false_node
if the argument is not a type.
2026-01-14 11:01:08 -05:00
Jakub Jelinek
16a7a7dd28 Remove annotations with erroneous types earlier. 2026-01-14 11:01:08 -05:00
Jakub Jelinek
97fb60db19 Change *display_string_of for direct base class relationships. 2026-01-14 11:01:07 -05:00
Jakub Jelinek
bc94613edd Assorted tweaks to eval_alignment_of. 2026-01-14 11:01:07 -05:00
Jakub Jelinek
1cc3dae768 Use the same throw_exception calls for the !complete_type_or_maybe_complain
and c_sizeof_or_alignof_type == error_mark_node cases, add metafn name.
2026-01-14 11:01:07 -05:00
Jakub Jelinek
d8e45233dd Add comments explaining why no special casing of references is needed for *size_of. 2026-01-14 11:01:07 -05:00
Jakub Jelinek
b8d7f79a11 Use type_of in eval_size_of even for FIELD_DECLs. 2026-01-14 11:01:07 -05:00
Jakub Jelinek
eb4569e1d0 offset -> offset_of in std::meta::exception argument from eval_offset_of 2026-01-14 11:01:07 -05:00
Jakub Jelinek
37d7a5eb20 Add missing parameter name to variable_of function comment. 2026-01-14 11:01:06 -05:00
Jakub Jelinek
5e8852ca21 Pass loc rather than location_of etc. to get_reflection_raw calls. 2026-01-14 11:01:06 -05:00
Jakub Jelinek
b40cb058be Small simplification for eval_is_noexcept. 2026-01-14 11:01:06 -05:00
Jakub Jelinek
c4ad08c045 Move get_vector_info function definition before use. 2026-01-14 11:01:06 -05:00
Marek Polacek
44d49d05a5 Move info(^^int) handling in cxx_eval_constant_expression
NFC
2026-01-14 11:01:06 -05:00
Marek Polacek
cd96edc08d Initialize std_meta_node in init_reflection 2026-01-14 11:01:06 -05:00
Jakub Jelinek
d08fb83ec6 Don't try to instantiate REFLECT_EXPR_HANDLE of REFLECT_ANNOTATION REFLECT_EXPR. 2026-01-14 11:01:05 -05:00
Jakub Jelinek
34e0841e21 Export build_stub_type and use it in reflect.cc where needed. 2026-01-14 11:01:05 -05:00
Jakub Jelinek
59af6f1796 Avoid doing any extra handling for remaining DECL_Ps or OVL_Ps, just use an assertion what can come up. 2026-01-14 11:01:05 -05:00
Jakub Jelinek
c6b5bd5100 Add direct_base_parent{_binfo,} helpers. 2026-01-14 11:01:05 -05:00
Jakub Jelinek
0d361404b7 Change eval_has_c_language_linkage to accept any non-lk_none linkage rather than only lk_external for DECL_LANGUAGE test. 2026-01-14 11:01:04 -05:00
Jakub Jelinek
b7aed3618d Remove strip_typedefs call from eval_is_complete_type. 2026-01-14 11:01:04 -05:00
Jakub Jelinek
236edbbf4f Don't uselessly call STRIP_TEMPLATE in eval_is_operator_function. 2026-01-14 11:01:04 -05:00
Eczbek
13053b0d0f c++: Make std::meta::operator_of() accept operator function templates [PR122771]
eval_operator_of() checks if a reflection does not
represent an operator function, but it should also check that
the reflection does not represent an operator function template.

	PR c++/122771

gcc/cp/ChangeLog:

	* reflect.cc (eval_operator_of): Add check for operator function
	templates and improve error message.

gcc/testsuite/ChangeLog:

	* g++.dg/reflect/operator_of1.C: Add tests for operator function
	templates.
2026-01-14 11:01:04 -05:00
Jakub Jelinek
46a06ed9b9 Rename temp_string_literal to get_string_literal, tweak its function comment. 2026-01-14 11:01:04 -05:00
Jakub Jelinek
98dc84243e Use maybe_get_reflection_fndecl in eval_is_function. 2026-01-14 11:01:04 -05:00
Jakub Jelinek
0646efcf02 If std::ranges::data or std::ranges::size are not variable templates, emit error
rather than following through into the non-contiguous handling.
2026-01-14 11:01:03 -05:00
Jakub Jelinek
4eb05609fa Simplify string literal type check. 2026-01-14 11:01:03 -05:00
Jakub Jelinek
6c6a9994f9 Adjust some diagnostic messages from get_range_elts. 2026-01-14 11:01:03 -05:00
Jakub Jelinek
da49fa7a11 Get rid of fail_ret in get_range_elts and return NULL_TREE; in more places. 2026-01-14 11:01:03 -05:00
Jakub Jelinek
441efa2374 Get rid of vector_identifier. 2026-01-14 11:01:03 -05:00
Jakub Jelinek
e3eba5a463 Accept all of int, long and long long in 130/131 mangling, not just long. 2026-01-14 11:01:03 -05:00
Marek Polacek
9441f4a0eb Fix extract1.C with -m32 2026-01-14 11:01:02 -05:00
Marek Polacek
9a6fabd3e8 Fix comparison of COMPONENT_REFs
Here we're comparing s.x to s.x and the individual operands of those
two trees are the same, but not the whole COMPONENT_REFs.
2026-01-14 11:01:02 -05:00
Jakub Jelinek
a5db46c5e6 Remove unneeded initializer. 2026-01-14 11:01:02 -05:00
Marek Polacek
1d72bef8aa Fix FIXME in extract1.C 2026-01-14 11:01:02 -05:00
Marek Polacek
c5798790c8 Fix is_noexcept crash
This ICE showed up after rebasing.
2026-01-14 11:01:02 -05:00
Marek Polacek
39c4c97dbf Rework consteval-only type cheking
Introduce check_consteval_only_fn and call it in grokfndecl
and instantiate_body.  Also make std::meta::exception special
member functions consteval.

I couldn't use check_consteval_only_fn in tsubst_function_decl
due to too many failures in libstdc++.
2026-01-14 11:01:02 -05:00
Jakub Jelinek
cdd1ebb14a Throw exception for direct base class relationship in can_substitute. 2026-01-14 11:01:01 -05:00
Jakub Jelinek
f7deaf83cd Clear parser->context->object_type instead of just temporarily clear it,
just use its value to add BASELINK if needed.
2026-01-14 11:01:01 -05:00
Jakub Jelinek
fdd8afa789 Fix further 4 static_asserts in member19.C.
What remains is that when we have ^^A::a where A is dependent scope
and ^^S::a is a variable template, when we tsubst that we error that
it is a template without template arguments.  Which shouldn't be a problem
when we reflect a template...
2026-01-14 11:01:01 -05:00
Jakub Jelinek
0ab8b96753 Fix another TODO in member19.C. 2026-01-14 11:01:01 -05:00
Marek Polacek
cc497bc0e8 Don't pass member_access_p to cp_parser_splice_specifier 2026-01-14 11:01:01 -05:00
Jakub Jelinek
d8655c0b94 Another test for function template splicing. 2026-01-14 11:01:00 -05:00
Marek Polacek
ffa35187b3 Check the return value of tsubst_expr 2026-01-14 11:01:00 -05:00
Jakub Jelinek
d0de6c58cd Further splice member access tests for static member variable templates. 2026-01-14 11:01:00 -05:00
Marek Polacek
63f96f2c50 Clear parser->scope 2026-01-14 11:01:00 -05:00
Marek Polacek
71c5b2f6b7 Fix TODO in extract1.C 2026-01-14 11:01:00 -05:00
Jakub Jelinek
df82e9f567 Fix 2 TODOs in member19.C. 2026-01-14 11:00:59 -05:00
Jakub Jelinek
58f99cb8f7 Fix up remaining TODOs in member18.C. 2026-01-14 11:00:59 -05:00
Jakub Jelinek
9b5b0d34b2 Handle splice_p for TEMPLATE_ID_EXPR in finish_class_member_access_expr. 2026-01-14 11:00:59 -05:00