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 class C { 17 public: 18 int foo(D *D); 19 }; 20 } 21 22 using namespace n; 23 24 int C::foo(D* D) { 25 return D->dump(); //% self.expect("expression -- D->dump()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) 26 //% self.expect("expression -- D::anInt()", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "2"]) 27 28 } 29 30 int main (int argc, char const *argv[]) 31 { 32 D myD { D::anInt() }; 33 C().foo(&myD); 34 return 0; 35 } 36