blob: 02e3f83974e2813d8bdd11774de54e8d3ab6c36c [file] [log] [blame]
Fariborz Jahanian4142ceb2010-05-26 20:19:07 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2// pr7029
3
4template <class Key, class T> struct QMap
5{
6 void insert(const Key &, const T &);
7 T v;
8};
9
10
11template <class Key, class T>
12void QMap<Key, T>::insert(const Key &, const T &avalue)
13{
14 v = avalue;
15}
16
17
18struct inotify_event
19{
20 int wd;
21
22 // clang doesn't like '[]':
23 // cannot initialize a parameter of type 'void *' with an rvalue of type 'char (*)[]'
24 char name [];
25};
26
27
28void foo()
29{
30 inotify_event event;
31 inotify_event* ptr = &event;
32 inotify_event event1 = *ptr;
33 *ptr = event;
34 QMap<int, inotify_event> eventForId;
35 eventForId.insert(ptr->wd, *ptr);
36}
37
38struct S {
39 virtual void foo();
40};
41
42struct X {
43 int blah;
Fariborz Jahanian2c0a5402010-05-26 20:46:24 +000044 S strings[]; // expected-error {{flexible array member 'strings' of non-POD element type 'S []'}}
Fariborz Jahanian4142ceb2010-05-26 20:19:07 +000045};