mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-09 17:11:20 +08:00
c++: Add test for PR90199.
Fixed by r11-2998, which fixed this ICE too. gcc/testsuite/ChangeLog: PR c++/90199 * g++.dg/cpp1y/constexpr-90199.C: New test.
This commit is contained in:
parent
9044db88d6
commit
0968df43cd
28
gcc/testsuite/g++.dg/cpp1y/constexpr-90199.C
Normal file
28
gcc/testsuite/g++.dg/cpp1y/constexpr-90199.C
Normal file
@ -0,0 +1,28 @@
|
||||
// PR c++/90199
|
||||
// { dg-do compile { target c++14 } }
|
||||
// { dg-additional-options "-frounding-math" }
|
||||
|
||||
template <typename>
|
||||
class complex;
|
||||
|
||||
template <typename D7> constexpr complex<D7>
|
||||
operator+ (complex<D7> hd, complex<D7> qc)
|
||||
{
|
||||
hd += qc;
|
||||
return hd;
|
||||
}
|
||||
|
||||
template <>
|
||||
class complex<float> {
|
||||
public:
|
||||
constexpr complex
|
||||
operator+= (complex rm)
|
||||
{
|
||||
jp += rm.jp;
|
||||
return *this;
|
||||
}
|
||||
|
||||
_Complex float jp;
|
||||
};
|
||||
|
||||
constexpr complex<float> fl{3.3}, ka{1.1}, r0 = fl + ka;
|
Loading…
x
Reference in New Issue
Block a user