xref: /minix3/external/bsd/llvm/dist/clang/test/Analysis/dtor-cxx11.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -analyze -std=c++11 -analyzer-checker=core,unix.Malloc,debug.ExprInspection -analyzer-config cfg-temporary-dtors=true -Wno-null-dereference -verify %s
2*0a6a1f1dSLionel Sambuc // expected-no-diagnostics
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc #include "Inputs/system-header-simulator-cxx.h"
5*0a6a1f1dSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc namespace Cxx11BraceInit {
7*0a6a1f1dSLionel Sambuc   struct Foo {
~FooCxx11BraceInit::Foo8*0a6a1f1dSLionel Sambuc     ~Foo() {}
9*0a6a1f1dSLionel Sambuc   };
10*0a6a1f1dSLionel Sambuc 
testInitializerList()11*0a6a1f1dSLionel Sambuc   void testInitializerList() {
12*0a6a1f1dSLionel Sambuc     for (Foo foo : {Foo(), Foo()}) {}
13*0a6a1f1dSLionel Sambuc   }
14*0a6a1f1dSLionel Sambuc }
15*0a6a1f1dSLionel Sambuc 
16