forked from OSchip/llvm-project
				
			Disable the "'extern' variable has an initializer" warning in C++,
since it makes sense there to have const extern variables. Fixes PR6495. llvm-svn: 101818
This commit is contained in:
		
							parent
							
								
									777346e749
								
							
						
					
					
						commit
						c81ca09830
					
				| 
						 | 
				
			
			@ -3818,7 +3818,8 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) {
 | 
			
		|||
      }
 | 
			
		||||
    }
 | 
			
		||||
  } else if (VDecl->isFileVarDecl()) {
 | 
			
		||||
    if (VDecl->getStorageClass() == VarDecl::Extern)
 | 
			
		||||
    if (VDecl->getStorageClass() == VarDecl::Extern && 
 | 
			
		||||
        !getLangOptions().CPlusPlus)
 | 
			
		||||
      Diag(VDecl->getLocation(), diag::warn_extern_init);
 | 
			
		||||
    if (!VDecl->isInvalidDecl()) {
 | 
			
		||||
      InitializationSequence InitSeq(*this, Entity, Kind, &Init, 1);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -0,0 +1,2 @@
 | 
			
		|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
 | 
			
		||||
extern const int PR6495 = 42;
 | 
			
		||||
		Loading…
	
		Reference in New Issue