]> granicus.if.org Git - clang/commitdiff
Pre-declare '::type_info' in MicrosoftMode only, not MicrosoftExt
authorAlp Toker <alp@nuanti.com>
Sun, 5 Jan 2014 06:38:18 +0000 (06:38 +0000)
committerAlp Toker <alp@nuanti.com>
Sun, 5 Jan 2014 06:38:18 +0000 (06:38 +0000)
It was previously enabled in both but should only have been part of the drop-in
quirks mode that is 'MicrosoftMode' given that it's only useful for
compatibility with the Microsoft headers/runtime.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198548 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/Sema.cpp
test/SemaCXX/MicrosoftCompatibility.cpp
test/SemaCXX/MicrosoftExtensions.cpp

index 35fd86fd251f789f6641543c34a0fab500519452..1c748f61e06ece73262dcca3995d529aaec12383 100644 (file)
@@ -179,7 +179,7 @@ void Sema::Initialize() {
   }
 
   // Initialize Microsoft "predefined C++ types".
-  if (PP.getLangOpts().MicrosoftExt && PP.getLangOpts().CPlusPlus) {
+  if (PP.getLangOpts().MicrosoftMode && PP.getLangOpts().CPlusPlus) {
     if (IdResolver.begin(&Context.Idents.get("type_info")) == IdResolver.end())
       PushOnScopeChains(Context.buildImplicitRecord("type_info", TTK_Class),
                         TUScope);
index 05037ac6a0d03b56fc26ce1c27efd157abe9c528..3097b7da107e2593f373937b3a0f95fca9b91f8d 100644 (file)
@@ -21,6 +21,11 @@ void test()
 }
 
 
+namespace ms_predefined_types {
+  // ::type_info is predeclared with forward class declartion
+  void f(const type_info &a);
+}
+
 
 namespace ms_protected_scope {
   struct C { C(); };
index 32b8adb5df3f69d2eb5e1b99a37f40087a47301d..6f90b6ae7c406d284d9e43f07ff1a3fc0ca46985 100644 (file)
@@ -1,10 +1,6 @@
 // RUN: %clang_cc1 %s -triple i686-pc-win32 -fsyntax-only -Wmicrosoft -Wc++11-extensions -Wno-long-long -verify -fms-extensions -fexceptions -fcxx-exceptions
 
 
-// ::type_info is predeclared with forward class declartion
-void f(const type_info &a);
-
-
 // Microsoft doesn't validate exception specification.
 namespace microsoft_exception_spec {