1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify -std=c++11 %s
10 void *&non_pointer() {
11 void *&r
= S
<T
>()[I
{}];
17 void *&r
= S
<T
>()[nullptr];
22 namespace LocalTemporary
{
27 T
value(const T
&t
= T()) const {
40 ptr
int1(const ptr
&p
= ptr()) {
44 ptr
int2(const ptr
&p
= nullptr) {
53 const int *int4(const int &x
= 5) {
57 const int *int5(const int &x
) {
62 const int &x
= 11; //expected-note{{binding reference variable 'x' here}}
63 return &x
; //expected-warning{{returning address of local temporary object}}
66 const int *int7(int x
) {
67 const int &x2
= x
; // expected-note{{binding reference variable 'x2' here}}
68 return &x2
; // expected-warning{{address of stack memory associated with parameter 'x' returned}}
71 const int *int8(const int &x
= 5) {
77 const int &x
= 5; // expected-note{{binding reference variable 'x' here}}
78 const int &x2
= x
; // expected-note{{binding reference variable 'x2' here}}
79 return &x2
; // expected-warning{{returning address of local temporary object}}