Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:28:17

0001 /*
0002  *  eventsetup_dataget_check_compile_time_error_t.cc
0003  *  EDMProto
0004  *
0005  *  Created by Chris Jones on 4/7/05.
0006  *
0007  */
0008 
0009 #include "FWCore/Framework/interface/EventSetup.h"
0010 #include "FWCore/Framework/interface/EventSetupProvider.h"
0011 #include "FWCore/Framework/interface/IOVSyncValue.h"
0012 #include "FWCore/Framework/interface/ESHandle.h"
0013 
0014 using namespace edm;
0015 class DataWithNoDefaultRecord {};
0016 
0017 int main() {
0018   eventsetup::EventSetupProvider provider;
0019   auto const& eventSetup = provider.eventSetupForInstance(IOVSyncValue(0));
0020   //This should cause a compile time failure since DataWithNoDefaultRecord
0021   /// does not have a default record assigned
0022   ESHandle<DataWithNoDefaultRecord> pData;
0023   eventSetup.getData(pData);
0024 
0025   return 0;
0026 }