// RUN: %clang_cc1 -fsyntax-only -verify -Wno-deprecated-builtins -std=c++98 %s
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-deprecated-builtins -std=c++11 %s
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-deprecated-builtins %s
// A program that calls for default-initialization or value-initialization of
// an entity of reference type is illformed. If T is a cv-qualified type, the
// cv-unqualified version of T is used for these definitions of
// zero-initialization, default-initialization, and value-initialization.
typedef int &IR;
IR r; // expected-error {{declaration of reference variable 'r' requires an initializer}}
int n = ; // expected-error {{reference to type 'int' requires an initializer}}
;
S s; // expected-note {{implicit default constructor for 'S' first required here}}
S
;
T t = ; // expected-note {{in value-initialization of type 'T' here}}
;
U u = ; // expected-note {{in value-initialization of type 'U' here}}
;
S s; // expected-error {{deleted default constructor}}
S
;
T t = ; // expected-error {{deleted default constructor}}
;
U u = ; // expected-error {{deleted default constructor}}
// Ensure that we handle C++11 in-class initializers properly as an extension.
// In this case, there is no user-declared default constructor, so we
// recursively apply the value-initialization checks, but we will emit a
// constructor call anyway, because the default constructor is not trivial.
;
V v = ; // ok
;
W w = ; // ok
// Ensure we're not faking this up by making the default constructor
// non-trivial.
;
;
;
;
;