   g<<<0,0>>>();
 }
 
-
-__device__ void devicef(void) {
+__device__ void devicef() {
   fp_t dp = d;
   fp_t cdp = cd;
   fp_t hp = h;
   // expected-error@-1 {{reference to __host__ function 'h' in __device__ function}}
-  // expected-note@66 {{'h' declared here}}
   fp_t chp = ch;
   // expected-error@-1 {{reference to __host__ function 'ch' in __device__ function}}
-  // expected-note@69 {{'ch' declared here}}
   fp_t dhp = dh;
   fp_t cdhp = cdh;
   gp_t gp = g; // expected-error {{reference to __global__ function 'g' in __device__ function}}
-               // expected-note@67 {{'g' declared here}}
 
   d();
   cd();
   h(); // expected-error {{no matching function for call to 'h'}}
-  // expected-note@66 {{candidate function not viable: call to __host__ function from __device__ function}}
   ch(); // expected-error {{no matching function for call to 'ch'}}
-  // expected-note@69 {{candidate function not viable: call to __host__ function from __device__ function}}
   dh();
   cdh();
   g(); // expected-error {{no matching function for call to 'g'}}
-  // expected-note@67 {{candidate function not viable: call to __global__ function from __device__ function}}
   g<<<0,0>>>(); // expected-error {{reference to __global__ function 'g' in __device__ function}}
-  // expected-note@67 {{'g' declared here}}
 }
 
-__global__ void globalf(void) {
+__global__ void globalf() {
   fp_t dp = d;
   fp_t cdp = cd;
   fp_t hp = h;
   // expected-error@-1 {{reference to __host__ function 'h' in __global__ function}}
-  // expected-note@66 {{'h' declared here}}
   fp_t chp = ch;
   // expected-error@-1 {{reference to __host__ function 'ch' in __global__ function}}
-  // expected-note@69 {{'ch' declared here}}
   fp_t dhp = dh;
   fp_t cdhp = cdh;
   gp_t gp = g;
   // expected-error@-1 {{reference to __global__ function 'g' in __global__ function}}
-  // expected-note@67 {{'g' declared here}}
 
   d();
   cd();
   h();
   // expected-error@-1 {{no matching function for call to 'h'}}
-  // expected-note@66 {{candidate function not viable: call to __host__ function from __global__ function}}
   ch();
   // expected-error@-1 {{no matching function for call to 'ch'}}
-  // expected-note@69 {{candidate function not viable: call to __host__ function from __global__ function}}
   dh();
   cdh();
   g(); // expected-error {{no matching function for call to 'g'}}
-  // expected-note@67 {{candidate function not viable: call to __global__ function from __global__ function}}
   g<<<0,0>>>(); // expected-error {{reference to __global__ function 'g' in __global__ function}}
-  // expected-note@67 {{'g' declared here}}
 }
 
-__host__ __device__ void hostdevicef(void) {
+__host__ __device__ void hostdevicef() {
   fp_t dp = d;
   fp_t cdp = cd;
+#if !defined(NOCHECKS) && !defined(__CUDA_ARCH__)
+  // expected-error@-3 {{reference to __device__ function 'd' in __host__ __device__ function}}
+  // expected-error@-3 {{reference to __device__ function 'cd' in __host__ __device__ function}}
+#endif
+
   fp_t hp = h;
   fp_t chp = ch;
-#if !defined(NOCHECKS)
-#if !defined(__CUDA_ARCH__)
-  // expected-error@-6 {{reference to __device__ function 'd' in __host__ __device__ function}}
-  // expected-note@65 {{'d' declared here}}
-  // expected-error@-7 {{reference to __device__ function 'cd' in __host__ __device__ function}}
-  // expected-note@68 {{'cd' declared here}}
-#else
-  // expected-error@-9 {{reference to __host__ function 'h' in __host__ __device__ function}}
-  // expected-note@66 {{'h' declared here}}
-  // expected-error@-10 {{reference to __host__ function 'ch' in __host__ __device__ function}}
-  // expected-note@69 {{'ch' declared here}}
-#endif
-#endif
+#if !defined(NOCHECKS) && defined(__CUDA_ARCH__)
+  // expected-error@-3 {{reference to __host__ function 'h' in __host__ __device__ function}}
+  // expected-error@-3 {{reference to __host__ function 'ch' in __host__ __device__ function}}
+#endif
+
   fp_t dhp = dh;
   fp_t cdhp = cdh;
   gp_t gp = g;
 #if defined(__CUDA_ARCH__)
   // expected-error@-2 {{reference to __global__ function 'g' in __host__ __device__ function}}
-  // expected-note@67 {{'g' declared here}}
 #endif
 
   d();
   cd();
+#if !defined(NOCHECKS) && !defined(__CUDA_ARCH__)
+  // expected-error@-3 {{no matching function for call to 'd'}}
+  // expected-error@-3 {{no matching function for call to 'cd'}}
+#endif
+
   h();
   ch();
-#if !defined(NOCHECKS)
-#if !defined(__CUDA_ARCH__)
-  // expected-error@-6 {{no matching function for call to 'd'}}
-  // expected-note@65 {{candidate function not viable: call to __device__ function from __host__ __device__ function}}
-  // expected-error@-7 {{no matching function for call to 'cd'}}
-  // expected-note@68 {{candidate function not viable: call to __device__ function from __host__ __device__ function}}
-#else
-  // expected-error@-9 {{no matching function for call to 'h'}}
-  // expected-note@66 {{candidate function not viable: call to __host__ function from __host__ __device__ function}}
-  // expected-error@-10 {{no matching function for call to 'ch'}}
-  // expected-note@69 {{candidate function not viable: call to __host__ function from __host__ __device__ function}}
-#endif
+#if !defined(NOCHECKS) && defined(__CUDA_ARCH__)
+  // expected-error@-3 {{no matching function for call to 'h'}}
+  // expected-error@-3 {{no matching function for call to 'ch'}}
 #endif
 
   dh();

  // expected-error@-3 {{call to global function g not configured}}
#else
  // expected-error@-5 {{no matching function for call to 'g'}}
  // expected-note@67 {{candidate function not viable: call to __global__ function from __host__ __device__ function}}
  // expected-error@-6 {{reference to __global__ function 'g' in __host__ __device__ function}}
  // expected-note@67 {{'g' declared here}}
#endif  // __CUDA_ARCH__
}



  d();
  // expected-error@-1 {{no matching function for call to 'd'}}
  cd();
  // expected-error@-1 {{no matching function for call to 'cd'}}
  h();
  ch();
  dh();
