Skip to content
Snippets Groups Projects
Commit 352c21c8 authored by Jason Merrill's avatar Jason Merrill
Browse files

c++: zero-init and class nttp [PR94568]

A zero-initializer should not reflect the constness of what it's
initializing, as it does not for initializers with different syntax.

This does have mangling implications for rare C++20 code, but it seems
infeasable to make the mangling depend on -fabi-version while fixing the
semantic bug, and C++20 is still experimental anyway.

	PR c++/94568

gcc/cp/ChangeLog:

	* init.cc (build_zero_init_1): Call cv_unqualified.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp2a/nontype-class36.C: Remove xfail.
	* g++.dg/cpp2a/nontype-class37.C: Remove xfail.
	* g++.dg/cpp1z/nontype-auto26.C: New test.
parent 2f759fa9
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment