[cfe-commits] r63238 - in /cfe/trunk: lib/AST/ASTContext.cpp test/Sema/merge-decls.c

Daniel Dunbar daniel at zuster.org
Wed Jan 28 13:22:12 PST 2009


Author: ddunbar
Date: Wed Jan 28 15:22:12 2009
New Revision: 63238

URL: http://llvm.org/viewvc/llvm-project?rev=63238&view=rev
Log:
Handle complex types in ASTContext::mergeTypes

Modified:
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/test/Sema/merge-decls.c

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=63238&r1=63237&r2=63238&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Wed Jan 28 15:22:12 2009
@@ -2615,6 +2615,9 @@
   case Type::Builtin:
     // Only exactly equal builtin types are compatible, which is tested above.
     return QualType();
+  case Type::Complex:
+    // Distinct complex types are incompatible.
+    return QualType();
   case Type::Vector:
     if (areCompatVectorTypes(LHS->getAsVectorType(), RHS->getAsVectorType()))
       return LHS;

Modified: cfe/trunk/test/Sema/merge-decls.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/merge-decls.c?rev=63238&r1=63237&r2=63238&view=diff

==============================================================================
--- cfe/trunk/test/Sema/merge-decls.c (original)
+++ cfe/trunk/test/Sema/merge-decls.c Wed Jan 28 15:22:12 2009
@@ -20,3 +20,12 @@
 // PR2502
 void (*f)(void);
 void (*f)() = 0;
+
+typedef __attribute__(( ext_vector_type(2) )) int Vi2;
+typedef __attribute__(( ext_vector_type(2) )) float Vf2;
+
+Vf2 g0; // expected-note {{previous definition is here}}
+Vi2 g0; // expected-error {{redefinition of 'g0'}}
+
+_Complex int g1; // expected-note {{previous definition is here}}
+_Complex float g1; // expected-error {{redefinition of 'g1'}}





More information about the cfe-commits mailing list