Properly handle non-canonical underlying types in
ASTContext::getUnaryTransformType.  This can happen if, for example,
an enumeration's underlying type is a typedef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152031 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/underlying_type.cpp b/test/SemaCXX/underlying_type.cpp
index dcfaab3..7bca06b 100644
--- a/test/SemaCXX/underlying_type.cpp
+++ b/test/SemaCXX/underlying_type.cpp
@@ -35,3 +35,9 @@
               "f has the wrong underlying type in the template");
 
 underlying_type<int>::type e; // expected-note {{requested here}}
+
+using uint = unsigned;
+enum class foo : uint { bar };
+ 
+static_assert(is_same_type<underlying_type<foo>::type, unsigned>::value,
+              "foo has the wrong underlying type");