blob: 073542dd15b0e2b222118118b6892701b7079bec [file] [log] [blame]
Rafael Espindolac4b1aea2013-10-04 14:33:42 +00001// RUN: %clang_cc1 %s -std=c++11 -emit-llvm-only
2// CHECK that we don't crash.
3
4// PR11676's example is ill-formed:
5/*
6union _XEvent {
7};
8void ProcessEvent() {
9 _XEvent pluginEvent = _XEvent();
10}
11*/
12
13// Example from PR11665:
14void f() {
15 union U { int field; } u = U();
16 (void)U().field;
17}
18
19namespace PR17476 {
20struct string {
21 string(const char *__s);
22 string &operator+=(const string &__str);
23};
24
25template <class ELFT> void finalizeDefaultAtomValues() {
26 auto startEnd = [&](const char * sym)->void {
27 string start("__");
28 start += sym;
29 }
30 ;
31 startEnd("preinit_array");
32}
33
34void f() { finalizeDefaultAtomValues<int>(); }
35}