Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C7510 compile error in debug_info.h using VS2019 on Windows #1270

Open
SRSaunders opened this issue Feb 4, 2025 · 1 comment · May be fixed by #1272
Open

C7510 compile error in debug_info.h using VS2019 on Windows #1270

SRSaunders opened this issue Feb 4, 2025 · 1 comment · May be fixed by #1272

Comments

@SRSaunders
Copy link
Contributor

SRSaunders commented Feb 4, 2025

I am not sure when this issue arose, but has shown up when compiling main using VS2019 on Windows 10. The issue is not a failure on macOS with clang. I have not checked Linux as of yet.

I am getting a build failure with a C7510 compile error (see https://learn.microsoft.com/en-us/cpp/error-messages/compiler-errors-2/compiler-error-c7510?view=msvc-170) in debug_info.h:

173>D:\VSProjects\Vulkan-Samples\framework\debug_info.h(194,38): error C7510: 'Static': use of dependent template name must be prefixed with 'template'
173>D:\VSProjects\Vulkan-Samples\framework\debug_info.h(186,7): message : This diagnostic occurred in the compiler generated function 'void vkb::DebugInfo::insert(const std::string &,A &&...)'
173>Done building project "hello_triangle_1_3.vcxproj" -- FAILED.

The problem is with the following line:

	void insert(const std::string &label, A &&...args)
	{
		...
		for (auto &field : fields)
		{
			if (field->label == label)
			{
--->				if (dynamic_cast<typename field::Static<T> *>(field.get()))
				{
					field = std::make_unique<C<T>>(label, args...);
				}
				return;
			}
		}
		...

The docs indicate that a template preface is required in this circumstance, like this:

				if (dynamic_cast<typename field::template Static<T> *>(field.get()))
				                                 ~~~~~~~~

When I make this change the problem goes away and builds can proceed successfully.

@SRSaunders
Copy link
Contributor Author

SRSaunders commented Feb 4, 2025

If it would make review and merge easier/faster, I could add this small fix onto my existing PR #1268. Please let me know if this approach would help or whether a different PR would be preferable.

UPDATE: Created separate PR as shown below.

@SRSaunders SRSaunders linked a pull request Feb 8, 2025 that will close this issue
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant