File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -6512,11 +6512,13 @@ void InitializationSequence::InitializeFrom(Sema &S,
65126512 // - The destination type is not a pointer and is not volatile-qualified.
65136513 // This checks for a specific scenario where a C-style cast might be necessary
65146514 // to convert between these specific types under these conditions.
6515- if (isa<PointerType>(SourceType) && !isa<PointerType>(DestType) &&
6516- SourceType.getAsString () != DestType.getAsString () &&
6517- SourceType.getAsString ().find (" volatile " ) != std::string::npos &&
6518- DestType.getAsString ().find (" volatile " ) == std::string::npos)
6519- IsCStyleCast = true ;
6515+ if (S.getLangOpts ().MSVCCompat || S.getLangOpts ().MicrosoftExt ) {
6516+ if (isa<PointerType>(SourceType) && !isa<PointerType>(DestType) &&
6517+ SourceType.getAsString () != DestType.getAsString () &&
6518+ SourceType.getAsString ().find (" volatile " ) != std::string::npos &&
6519+ DestType.getAsString ().find (" volatile " ) == std::string::npos)
6520+ IsCStyleCast = true ;
6521+ }
65206522
65216523 // - Otherwise, the initial value of the object being initialized is the
65226524 // (possibly converted) value of the initializer expression. Standard
You can’t perform that action at this time.
0 commit comments