Neither of the current clients of CFGRecStmtDeclVisitor are doing
anything with typedefs, so I assume type aliases (C++11 "using")
can be safely ignored. This was causing assertion failures in
the analyzer.
<rdar://problem/
13228440>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175335
91177308-0d34-0410-b5e6-
96231b3b80d8
DISPATCH_CASE(ImplicitParam)
DISPATCH_CASE(EnumConstant)
DISPATCH_CASE(Typedef)
+ DISPATCH_CASE(TypeAlias)
DISPATCH_CASE(Record) // FIXME: Refine. VisitStructDecl?
DISPATCH_CASE(CXXRecord)
DISPATCH_CASE(Enum)
DEFAULT_DISPATCH(ImplicitParam)
DEFAULT_DISPATCH(EnumConstant)
DEFAULT_DISPATCH(Typedef)
+ DEFAULT_DISPATCH(TypeAlias)
DEFAULT_DISPATCH(Record)
DEFAULT_DISPATCH(Enum)
DEFAULT_DISPATCH(Field)
-// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
-// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -analyze -analyzer-store=region -analyzer-constraints=range -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++11 -analyze -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
+// RUN: %clang_cc1 -fcxx-exceptions -fexceptions -std=c++11 -analyze -analyzer-store=region -analyzer-constraints=range -analyzer-checker=deadcode.DeadStores -verify -Wno-unreachable-code %s
//===----------------------------------------------------------------------===//
// Basic dead store checking (but in C++ mode).
}
catch (void *) {}
}
+
+
+void testCXX11Using() {
+ using Int = int;
+ Int value;
+ value = 1; // expected-warning {{never read}}
+}