diff --git a/clang/test/Modules/Inputs/set-pure-crash/a.h b/clang/test/Modules/Inputs/set-pure-crash/a.h new file mode 100644 --- /dev/null +++ b/clang/test/Modules/Inputs/set-pure-crash/a.h @@ -0,0 +1,11 @@ +#pragma once + +struct Tag {}; + +template +class Base { +public: + virtual void func() = 0; +}; + +Base bar(); diff --git a/clang/test/Modules/Inputs/set-pure-crash/b.h b/clang/test/Modules/Inputs/set-pure-crash/b.h new file mode 100644 --- /dev/null +++ b/clang/test/Modules/Inputs/set-pure-crash/b.h @@ -0,0 +1,14 @@ +#pragma once + +#include "a.h" +#include "c.h" + +template > +void foo(Fun) {} + +class Child : public Base { +public: + void func() { + foo([]() {}); + } +}; diff --git a/clang/test/Modules/Inputs/set-pure-crash/c.h b/clang/test/Modules/Inputs/set-pure-crash/c.h new file mode 100644 --- /dev/null +++ b/clang/test/Modules/Inputs/set-pure-crash/c.h @@ -0,0 +1,5 @@ +#pragma once + +template +struct func { +}; diff --git a/clang/test/Modules/Inputs/set-pure-crash/module.modulemap b/clang/test/Modules/Inputs/set-pure-crash/module.modulemap new file mode 100644 --- /dev/null +++ b/clang/test/Modules/Inputs/set-pure-crash/module.modulemap @@ -0,0 +1,11 @@ +module a { + header "a.h" +} + +module b { + header "b.h" +} + +module c { + header "c.h" +} diff --git a/clang/test/Modules/set-pure-crash.cpp b/clang/test/Modules/set-pure-crash.cpp new file mode 100644 --- /dev/null +++ b/clang/test/Modules/set-pure-crash.cpp @@ -0,0 +1,9 @@ +// RUN: rm -rf %t +// RUN: %clang_cc1 -O0 -emit-llvm -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x c++ -I %S/Inputs/set-pure-crash -verify %s -o %t + +// expected-no-diagnostics + +#include "b.h" +#include "c.h" + +auto t = func();