1 //===-- main.cpp ------------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 namespace n { 10 struct D { 11 int i; 12 static int anInt() { return 2; } 13 int dump() { return i; } 14 }; 15 } 16 17 using namespace n; 18 19 int foo(D* D) { 20 return D->dump(); //% self.expect("expression -- D->dump()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) 21 } 22 23 int main (int argc, char const *argv[]) 24 { 25 D myD { D::anInt() }; 26 foo(&myD); 27 return 0; 28 } 29