Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / subst-func-type-invalid-ret-type.cpp
blob565e06b101a7b27981bc4b1b054167910a3d4082
1 // RUN: %clang -fsyntax-only -std=c++17 %s -Xclang -verify
3 // The important part is that we do not crash.
5 template<typename T> T declval();
7 template <typename T>
8 auto Call(T x) -> decltype(declval<T>()(0)) {}
10 class Status {};
12 void fun() {
13 // The Status() (instead of Status) here used to cause a crash.
14 Call([](auto x) -> Status() {}); // expected-error{{function cannot return function type 'Status ()}}