| 1 |
// RUN: rm -rf %t && mkdir %t |
| 2 |
// RUN: mkdir -p %t/ctudir |
| 3 |
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \ |
| 4 |
// RUN: -emit-pch -o %t/ctudir/ctu-cxxdefaultinitexpr-import.cpp.ast %S/Inputs/ctu-cxxdefaultinitexpr-import.cpp |
| 5 |
// RUN: cp %S/Inputs/ctu-cxxdefaultinitexpr-import.cpp.externalDefMap.ast-dump.txt %t/ctudir/externalDefMap.txt |
| 6 |
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -std=c++17 \ |
| 7 |
// RUN: -analyzer-checker=core \ |
| 8 |
// RUN: -analyzer-config experimental-enable-naive-ctu-analysis=true \ |
| 9 |
// RUN: -analyzer-config ctu-dir=%t/ctudir \ |
| 10 |
// RUN: -verify %s |
| 11 |
|
| 12 |
// Check that importing this code does not cause crash. |
| 13 |
// expected-no-diagnostics |
| 14 |
|
| 15 |
namespace QHashPrivate { |
| 16 |
template <typename> int b; |
| 17 |
struct Data; |
| 18 |
} // namespace QHashPrivate |
| 19 |
|
| 20 |
struct QDomNodePrivate {}; |
| 21 |
template <typename = struct QString> struct QMultiHash { |
| 22 |
QHashPrivate::Data *d = nullptr; |
| 23 |
}; |
| 24 |
|
| 25 |
struct QDomNamedNodeMapPrivate { |
| 26 |
QMultiHash<> map; |
| 27 |
}; |
| 28 |
struct QDomElementPrivate : QDomNodePrivate { |
| 29 |
QDomElementPrivate(); |
| 30 |
void importee(); |
| 31 |
QMultiHash<> *m_attr = nullptr; |
| 32 |
}; |
| 33 |
// --------- common part end --------- |
| 34 |
|
| 35 |
void importer(QDomElementPrivate x) { x.importee(); } |