1 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -fno-cuda-host-device-constexpr -verify %s
2 // RUN: %clang_cc1 -std=c++11 -fsyntax-only -fno-cuda-host-device-constexpr -fcuda-is-device -verify %s
4 #include "Inputs/cuda.h"
6 // Check that, with -fno-cuda-host-device-constexpr, constexpr functions are
7 // host-only, and __device__ constexpr functions are still device-only.
9 constexpr int f() { return 0; } // expected-note {{not viable}}
10 __device__ constexpr int g() { return 0; } // expected-note {{not viable}}
12 void __device__ foo() {
13 f(); // expected-error {{no matching function}}
19 g(); // expected-error {{no matching function}}