c++: constantness of call to function pointer [PR111703]
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr102581.C
blob7f172d088b8327ba16ed7c9cad319f75f43365ac
1 // { dg-do compile }
2 /* { dg-additional-options "-fno-strict-aliasing" } */
3 enum VkStructureType {
4   VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT,
5   VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR
6 } typedef VkPhysicalDeviceSparseProperties;
7 struct VkPhysicalDeviceProperties {
8   int apiVersion;
9   VkPhysicalDeviceSparseProperties sparseProperties;
11 typedef struct {
12   VkStructureType sType;
13   int *pPhysicalDevices;
14 } VkPhysicalDeviceFeatures2;
15 typedef struct VkPhysicalDeviceProperties2 {
16   VkStructureType sType;
17   void *pNext;
18 } VkPhysicalDeviceMemoryProperties2;
19 struct VulkanVersion {
20   int major;
21   int minor;
22   int patch;
24 int make_vulkan_version_version;
25 VulkanVersion make_vulkan_version() {
26   return {make_vulkan_version_version, make_vulkan_version_version,
27           make_vulkan_version_version};
29 struct AppGpu {
30   int &inst;
31   int id;
32   int *phys_device = nullptr;
33   VulkanVersion api_version{};
34   VkPhysicalDeviceProperties props{};
35   VkPhysicalDeviceProperties2 props2{};
36   int memory_props{};
37   VkPhysicalDeviceMemoryProperties2 memory_props2{};
38   int features{};
39   VkPhysicalDeviceFeatures2 features2{};
40   int *dev = nullptr;
41   int enabled_features{};
42   int AppGpu_phys_device;
43   int AppGpu_inst;
44   AppGpu() : inst(AppGpu_inst), id() {
45     api_version = make_vulkan_version();
46     props2.sType = memory_props2.sType = features2.sType =
47         VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
48   }
50 int
51 main() { AppGpu(); return 0; }