diff clang/test/Sema/enable_if.c @ 207:2e18cbf3894f

LLVM12
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 08 Jun 2021 06:07:14 +0900
parents 1d019706d866
children c4bab56944e8
line wrap: on
line diff
--- a/clang/test/Sema/enable_if.c	Mon May 25 11:55:54 2020 +0900
+++ b/clang/test/Sema/enable_if.c	Tue Jun 08 06:07:14 2021 +0900
@@ -5,7 +5,7 @@
 typedef int mode_t;
 typedef unsigned long size_t;
 
-const int TRUE = 1;
+enum { TRUE = 1 };
 
 int open(const char *pathname, int flags) __attribute__((enable_if(!(flags & O_CREAT), "must specify mode when using O_CREAT"))) __attribute__((overloadable));  // expected-note{{candidate disabled: must specify mode when using O_CREAT}}
 int open(const char *pathname, int flags, mode_t mode) __attribute__((overloadable));  // expected-note{{candidate function not viable: requires 3 arguments, but 2 were provided}}
@@ -114,7 +114,7 @@
 int global;
 void f(int n) __attribute__((enable_if(global == 0, "chosen when 'global' is zero")));  // expected-error{{'enable_if' attribute expression never produces a constant expression}}  // expected-note{{subexpression not valid in a constant expression}}
 
-const int cst = 7;
+enum { cst = 7 };
 void return_cst(void) __attribute__((overloadable)) __attribute__((enable_if(cst == 7, "chosen when 'cst' is 7")));
 void test_return_cst() { return_cst(); }