File tree 1 file changed +7
-5
lines changed
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,
6512
6512
// - The destination type is not a pointer and is not volatile-qualified.
6513
6513
// This checks for a specific scenario where a C-style cast might be necessary
6514
6514
// 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
+ }
6520
6522
6521
6523
// - Otherwise, the initial value of the object being initialized is the
6522
6524
// (possibly converted) value of the initializer expression. Standard
You can’t perform that action at this time.
0 commit comments