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

In microsoft mode, delay default template argument checking until template definition time #13077

Closed
nico opened this issue Apr 30, 2012 · 6 comments
Labels
bugzilla Issues migrated from bugzilla c++

Comments

@nico
Copy link
Contributor

nico commented Apr 30, 2012

Bugzilla Link 12705
Resolution FIXED
Resolved on Aug 11, 2014 11:48
Version unspecified
OS Windows NT
Blocks llvm/llvm-bugzilla-archive#13707
CC @majnemer,@DougGregor,@zmodem,@tritao,@rnk

Extended Description

template<class T, class S = Foo>
class Class;

class Foo {};

template<class T, class S>
class Class {
};

C:\src\chrome\src>cl test.cc /c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.30319.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

test.cc

C:\src\chrome\src>....\llvm-build\bin\Release\clang.exe -c test.cc
test.cc:1:29: error: unknown type name 'Foo'
template<class T, class S = Foo>
^
1 error generated.

This is required to parse atlwin.h

@nico
Copy link
Contributor Author

nico commented Jun 25, 2012

cl also accepts:

template<class T, class S = Foo>
class Class;

template<class T, class S>
class Class {
};

class Foo {};

void f() {
Class c;
}

It doesn't accept:

template<class T, class S = Foo>
class Class;

template<class T, class S>
class Class {
};

void f() {
Class c;
}

class Foo {};

@zmodem
Copy link
Collaborator

zmodem commented Jun 3, 2013

*** Bug llvm/llvm-bugzilla-archive#16180 has been marked as a duplicate of this bug. ***

@rnk
Copy link
Collaborator

rnk commented Aug 11, 2014

This was fixed in r210382, we accept with a warning:

$ clang -c t.cpp
t.cpp:1:29: warning: using the undeclared type 'Foo' as a default template argument is a Microsoft extension [-Wmicrosoft]
template<class T, class S = Foo>
^
1 warning generated.

@tritao
Copy link
Mannequin

tritao mannequin commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#13707

@zmodem
Copy link
Collaborator

zmodem commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#16180

@rnk
Copy link
Collaborator

rnk commented Nov 26, 2021

mentioned in issue llvm/llvm-bugzilla-archive#18714

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla c++
Projects
None yet
Development

No branches or pull requests

3 participants