summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/scoped-enums.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-05-20 16:38:50 +0000
committerDouglas Gregor <dgregor@apple.com>2011-05-20 16:38:50 +0000
commit575a1c9dc8dc5b4977194993e289f9eda7295c39 (patch)
tree0c66c4e1cf78a06c917e05557458f05fcf025a99 /test/CodeGenCXX/scoped-enums.cpp
parentf752d5bbaee7485b484f5e6aa69e50748e02dda8 (diff)
Introduce Type::isSignedIntegerOrEnumerationType() and
Type::isUnsignedIntegerOrEnumerationType(), which are like Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also consider the underlying type of a C++0x scoped enumeration type. Audited all callers to the existing functions, switching those that need to also handle scoped enumeration types (e.g., those that deal with constant values) over to the new functions. Fixes PR9923 / <rdar://problem/9447851>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/scoped-enums.cpp')
-rw-r--r--test/CodeGenCXX/scoped-enums.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGenCXX/scoped-enums.cpp b/test/CodeGenCXX/scoped-enums.cpp
new file mode 100644
index 0000000000..d40ab36511
--- /dev/null
+++ b/test/CodeGenCXX/scoped-enums.cpp
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -std=c++0x -emit-llvm -o - %s
+
+// PR9923
+enum class Color { red, blue, green };
+
+void f(Color);
+void g() {
+ f(Color::red);
+}