1 // RUN: %clang_cc1 -std=c++1y -S -o - -emit-llvm -verify %s
3 namespace default_arg_temporary
{
5 constexpr bool equals(const float& arg
= 1.0f
) {
9 constexpr const int &x(const int &p
= 0) {
14 constexpr S(const int &a
= 0) {}
17 void test_default_arg2() {
18 // This piece of code used to cause an assertion failure in
19 // CallStackFrame::createTemporary because the same MTE is used to initilize
20 // both elements of the array (see PR33140).
21 constexpr S s
[2] = {};
23 // This piece of code used to cause an assertion failure in
24 // CallStackFrame::createTemporary because multiple CXXDefaultArgExpr share
25 // the same MTE (see PR33140).
26 static_assert(equals() && equals(), "");
28 // Test that constant expression evaluation produces distinct lvalues for
30 static_assert(&x() != &x(), "");
33 // Check that multiple CXXDefaultInitExprs don't cause an assertion failure.
34 struct A
{ int &&r
= 0; }; // expected-note 2{{default member initializer}}
36 B b
= {}; // expected-warning 2{{not supported}}