// RUN: %clang_cc1 -fexperimental-new-constant-interpreter -std=c++17 -verify=expected,both %s // RUN: %clang_cc1 -std=c++17 -verify=ref,both %s template struct A {}; namespace Temp { struct S { int n; }; constexpr S &addr(S &&s) { return s; } A a; // both-error {{reference to temporary object}} A b; // both-error {{pointer to temporary object}} A c; // both-error {{reference to subobject of temporary object}} A d; // both-error {{pointer to subobject of temporary object}} } char arr[3]; A d; // both-error {{refers to subobject '&arr[1]'}} void Func() { A a; // both-error {{pointer to subobject of predefined '__func__' variable}} }