Index: include/clang/Basic/DiagnosticSemaKinds.td
===================================================================
--- include/clang/Basic/DiagnosticSemaKinds.td	(revision 173202)
+++ include/clang/Basic/DiagnosticSemaKinds.td	(working copy)
@@ -4415,6 +4415,14 @@
 def err_bad_reinterpret_cast_overload : Error<
   "reinterpret_cast cannot resolve overloaded function %0 to type %1">;
 
+def warn_reinterpret_updowncast : Warning<
+  "'reinterpret_cast' is used as an %select{upcast|downcast}0 from type %1 "
+  "to its %select{base|derived}0 type %2">, InGroup<ReinterpretUpDownCast>,
+  DefaultIgnore;
+def note_reinterpret_updowncast_use_static_cast : Note<
+  "use of 'static_cast' adjusts the pointer correctly while "
+  "%select{upcasting|downcasting}0">;
+
 def err_bad_static_cast_overload : Error<
   "address of overloaded function %0 cannot be static_cast to type %1">;
 
Index: include/clang/Basic/DiagnosticGroups.td
===================================================================
--- include/clang/Basic/DiagnosticGroups.td	(revision 173202)
+++ include/clang/Basic/DiagnosticGroups.td	(working copy)
@@ -260,6 +261,7 @@
 
 def : DiagGroup<"type-limits">;
 def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">;
+def ReinterpretUpDownCast : DiagGroup<"reinterpret-updown">;
 def Unicode  : DiagGroup<"unicode">;
 def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
 def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">;
Index: lib/Sema/SemaCast.cpp
===================================================================
--- lib/Sema/SemaCast.cpp	(revision 173202)
+++ lib/Sema/SemaCast.cpp	(working copy)
@@ -678,6 +678,56 @@
       << SrcExpr.get()->getType() << DestType << OpRange;
 }
 
+/// ReinterpretUpDownCast - Check that a reinterpret_cast\<DestType\>(SrcExpr)
+/// is not used as upcast or downcast between respective pointers or
+/// references.
+static void ReinterpretUpDownCast(Sema &Self, ExprResult &SrcExpr,
+                                  QualType DestType,
+                                  const SourceRange &OpRange) {
+  QualType SrcType = SrcExpr.get()->getType();
+  const Type *SrcUnqualType = SrcType.getTypePtr();
+  const Type *DestUnqualType = DestType.getTypePtr();
+
+  // When casting from pointer or reference, get pointee type; use original 
+  // type otherwise.
+  const CXXRecordDecl *SrcPointeeRD = SrcUnqualType->getPointeeCXXRecordDecl();
+  const CXXRecordDecl *SrcRD =
+    SrcPointeeRD ? SrcPointeeRD : SrcUnqualType->getAsCXXRecordDecl();
+
+  if(!SrcRD || !SrcRD->hasDefinition())
+    return;
+
+  const CXXRecordDecl *DestRD = DestUnqualType->getPointeeCXXRecordDecl();
+
+  if(!DestRD || !DestRD->hasDefinition())
+    return;
+
+  enum {
+    ReinterpretNormalCast = -1,
+    ReinterpretUpcast,
+    ReinterpretDowncast
+  } ReinterpretKind;
+  ReinterpretKind = ReinterpretNormalCast;
+
+  if (SrcRD->isDerivedFrom(DestRD) ||
+      SrcRD->isVirtuallyDerivedFrom(DestRD)) {
+    ReinterpretKind = ReinterpretUpcast;
+  } else if (DestRD->isDerivedFrom(SrcRD) ||
+             DestRD->isVirtuallyDerivedFrom(DestRD)) {
+    ReinterpretKind = ReinterpretDowncast;
+  }
+
+  if (ReinterpretKind != ReinterpretNormalCast)
+  {
+    Self.Diag(OpRange.getBegin(), diag::warn_reinterpret_updowncast)
+      << ReinterpretKind << SrcType << DestType << OpRange;
+    Self.Diag(OpRange.getBegin(),
+              diag::note_reinterpret_updowncast_use_static_cast)
+      << ReinterpretKind;
+    // TODO: emit a fixit (should pass cast operator SourceRange from Parser)
+  }
+}
+
 /// CheckReinterpretCast - Check that a reinterpret_cast\<DestType\>(SrcExpr) is
 /// valid.
 /// Refer to C++ 5.2.10 for details. reinterpret_cast is typically used in code
@@ -691,6 +741,8 @@
   if (SrcExpr.isInvalid()) // if conversion failed, don't report another error
     return;
 
+  ReinterpretUpDownCast(Self, SrcExpr, DestType, OpRange);
+
   unsigned msg = diag::err_bad_cxx_cast_generic;
   TryCastResult tcr = 
     TryReinterpretCast(Self, SrcExpr, DestType, 
Index: test/SemaCXX/reinterpret-cast.cpp
===================================================================
--- test/SemaCXX/reinterpret-cast.cpp	(revision 173202)
+++ test/SemaCXX/reinterpret-cast.cpp	(working copy)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding -Wundefined-reinterpret-cast -Wno-unused-volatile-lvalue %s
+// RUN: %clang_cc1 -fsyntax-only -verify -ffreestanding -Wundefined-reinterpret-cast -Wreinterpret-updown -Wno-unused-volatile-lvalue %s
 
 #include <stdint.h>
 
@@ -276,10 +276,6 @@
   // contained union)
   // TODO: checking is not implemented for tag types
 
-  // a type that is a (possible cv-qualified) base class type of the dynamic
-  // type of the object
-  // TODO: checking is not implemented for tag types
-
   // a char or unsigned char type
   (void)reinterpret_cast<char&>(a);
   (void)*reinterpret_cast<char*>(&a);
@@ -290,3 +286,197 @@
   (void)reinterpret_cast<unsigned char&>(b);
   (void)*reinterpret_cast<unsigned char*>(&b);
 }
+
+namespace PR13824 {
+// PR 13824
+class A {
+};
+class DA : public A {
+};
+class DDA : public DA {
+};
+class DAo : protected A {
+};
+class DAi : private A {
+};
+
+class DVA : public virtual A {
+};
+class DDVA : public virtual DA {
+};
+class DMA : public virtual A, public virtual DA {
+};
+
+class B;
+
+class C {
+};
+
+void reinterpret_not_defined_class(B *b, C *c) {
+  // should not fail if class has no definition
+  (void)*reinterpret_cast<C *>(b);
+  (void)*reinterpret_cast<B *>(c);
+
+  (void)reinterpret_cast<C &>(*b);
+  (void)reinterpret_cast<B &>(*c);
+}
+
+void reinterpret_not_updowncast(A *pa, const A *pca, A &a, const A &ca) {
+  (void)*reinterpret_cast<C *>(pa);
+  (void)*reinterpret_cast<const C *>(pa);
+  (void)*reinterpret_cast<volatile C *>(pa);
+  (void)*reinterpret_cast<const volatile C *>(pa);
+
+  (void)*reinterpret_cast<const C *>(pca);
+  (void)*reinterpret_cast<const volatile C *>(pca);
+
+  (void)reinterpret_cast<C &>(a);
+  (void)reinterpret_cast<const C &>(a);
+  (void)reinterpret_cast<volatile C &>(a);
+  (void)reinterpret_cast<const volatile C &>(a);
+
+  (void)reinterpret_cast<const C &>(ca);
+  (void)reinterpret_cast<const volatile C &>(ca);
+}
+
+void reinterpret_pointer_downcast(A *a, const A *ca) {
+
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<DA *>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A *' to its derived type 'PR13824::DA *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<const DA *>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A *' to its derived type 'const PR13824::DA *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<volatile DA *>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A *' to its derived type 'volatile PR13824::DA *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<const volatile DA *>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A *' to its derived type 'const volatile PR13824::DA *'}}
+
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<const DA *>(ca); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'const PR13824::A *' to its derived type 'const PR13824::DA *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<const volatile DA *>(ca); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'const PR13824::A *' to its derived type 'const volatile PR13824::DA *'}}
+
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<DDA *>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A *' to its derived type 'PR13824::DDA *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<DAo *>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A *' to its derived type 'PR13824::DAo *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<DAi *>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A *' to its derived type 'PR13824::DAi *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<DVA *>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A *' to its derived type 'PR13824::DVA *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<DDVA *>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A *' to its derived type 'PR13824::DDVA *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)*reinterpret_cast<DMA *>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A *' to its derived type 'PR13824::DMA *'}}
+}
+
+void reinterpret_reference_downcast(A a, A &ra, const A &cra) {
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<DA &>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'PR13824::DA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<const DA &>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'const PR13824::DA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<volatile DA &>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'volatile PR13824::DA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<const volatile DA &>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'const volatile PR13824::DA &'}}
+
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<DA &>(ra); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'PR13824::DA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<const DA &>(ra); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'const PR13824::DA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<volatile DA &>(ra); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'volatile PR13824::DA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<const volatile DA &>(ra); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'const volatile PR13824::DA &'}}
+
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<const DA &>(cra); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'const PR13824::A' to its derived type 'const PR13824::DA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<const volatile DA &>(cra); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'const PR13824::A' to its derived type 'const volatile PR13824::DA &'}}
+
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<DDA &>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'PR13824::DDA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<DAo &>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'PR13824::DAo &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<DAi &>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'PR13824::DAi &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<DVA &>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'PR13824::DVA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<DDVA &>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'PR13824::DDVA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while downcasting}}
+  (void)reinterpret_cast<DMA &>(a); // expected-warning {{'reinterpret_cast' is used as an downcast from type 'PR13824::A' to its derived type 'PR13824::DMA &'}}
+}
+
+void reinterpret_pointer_upcast(DA *da, const DA *cda, DDA *dda, DAo *dao, 
+                                DAi *dai, DVA *dva, DDVA *ddva, DMA *dma) {
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<A *>(da); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DA *' to its base type 'PR13824::A *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<const A *>(da); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DA *' to its base type 'const PR13824::A *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<volatile A *>(da); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DA *' to its base type 'volatile PR13824::A *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<const volatile A *>(da); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DA *' to its base type 'const volatile PR13824::A *'}}
+
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<const A *>(cda); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'const PR13824::DA *' to its base type 'const PR13824::A *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<const volatile A *>(cda); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'const PR13824::DA *' to its base type 'const volatile PR13824::A *'}}
+
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<A *>(dda); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DDA *' to its base type 'PR13824::A *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<DA *>(dda); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DDA *' to its base type 'PR13824::DA *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<A *>(dao); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DAo *' to its base type 'PR13824::A *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<A *>(dai); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DAi *' to its base type 'PR13824::A *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<A *>(dva); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DVA *' to its base type 'PR13824::A *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<A *>(ddva); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DDVA *' to its base type 'PR13824::A *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<DA *>(ddva); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DDVA *' to its base type 'PR13824::DA *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<A *>(dma); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DMA *' to its base type 'PR13824::A *'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)*reinterpret_cast<DA *>(dma); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DMA *' to its base type 'PR13824::DA *'}}
+}
+
+void reinterpret_reference_upcast(DA &da, const DA &cda, DDA &dda, DAo &dao,
+                                  DAi &dai, DVA &dva, DDVA &ddva, DMA &dma) {
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<A &>(da); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DA' to its base type 'PR13824::A &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<const A &>(da); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DA' to its base type 'const PR13824::A &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<volatile A &>(da); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DA' to its base type 'volatile PR13824::A &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<const volatile A &>(da); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DA' to its base type 'const volatile PR13824::A &'}}
+
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<const A &>(cda); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'const PR13824::DA' to its base type 'const PR13824::A &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<const volatile A &>(cda); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'const PR13824::DA' to its base type 'const volatile PR13824::A &'}}
+
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<A &>(dda); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DDA' to its base type 'PR13824::A &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<DA &>(dda); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DDA' to its base type 'PR13824::DA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<A &>(dao); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DAo' to its base type 'PR13824::A &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<A &>(dai); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DAi' to its base type 'PR13824::A &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<A &>(dva); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DVA' to its base type 'PR13824::A &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<A &>(ddva); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DDVA' to its base type 'PR13824::A &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<DA &>(ddva); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DDVA' to its base type 'PR13824::DA &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<A &>(dma); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DMA' to its base type 'PR13824::A &'}}
+  // expected-note@+1 {{use of 'static_cast' adjusts the pointer correctly while upcasting}}
+  (void)reinterpret_cast<DA &>(dma); // expected-warning {{'reinterpret_cast' is used as an upcast from type 'PR13824::DMA' to its base type 'PR13824::DA &'}}
+}
+
+} // end namespace PR13824
