From fd0cabb8ebc201809db8f9ce10bbb9c2480535ea Mon Sep 17 00:00:00 2001 From: Elias Holzer Date: Fri, 11 Apr 2014 17:02:17 +0200 Subject: [PATCH] Desugar a type to test whether or not it is a tag declaration. --- src/AST/TypeExtensions.cs | 2 +- tests/Basic/Basic.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/AST/TypeExtensions.cs b/src/AST/TypeExtensions.cs index 1b4d7bc6..7570dc45 100644 --- a/src/AST/TypeExtensions.cs +++ b/src/AST/TypeExtensions.cs @@ -114,7 +114,7 @@ public static bool IsTagDecl(this Type t, out T decl) where T : Declaration { - var tag = t as TagType; + var tag = t.Desugar() as TagType; if (tag == null) { diff --git a/tests/Basic/Basic.h b/tests/Basic/Basic.h index 490d7072..01860bf0 100644 --- a/tests/Basic/Basic.h +++ b/tests/Basic/Basic.h @@ -302,3 +302,13 @@ struct EmptyNamedNestedEnum { enum { Value = 10 }; }; + + +typedef struct SomeStruct +{ +} +SomeStruct; + +class SomeClassExtendingTheStruct : public SomeStruct +{ +}; \ No newline at end of file